File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
2- import process from "node:process" ;
32import { Command } from "commander" ;
3+ import makeDebug from "debug" ;
4+
45import { Indiekit } from "@indiekit/indiekit" ;
56import { defaultConfig } from "../config/defaults.js" ;
67
@@ -19,7 +20,8 @@ program
1920 const { debug, port } = options ;
2021
2122 if ( debug ) {
22- process . env . DEBUG = debug ? `${ debug } :*` : "*" ;
23+ // Debug everything if no scope, else only debug within provided scope
24+ makeDebug . enable ( debug === true ? `*` : debug ) ;
2325 }
2426
2527 const indiekit = new Indiekit ( {
Original file line number Diff line number Diff line change 1- import Debug from "debug" ;
1+ import makeDebug from "debug" ;
22
3- const debug = new Debug ( "indiekit:request" ) ;
3+ const debug = makeDebug ( "indiekit:request" ) ;
44
55export const logging = ( request , response , next ) => {
6+ // Send debug logging output to console.info
7+ debug . log = console . info . bind ( console ) ;
8+
69 debug ( "url" , request . originalUrl ) ;
710 debug ( "headers" , request . headers ) ;
811 debug ( "body" , request . body ) ;
You can’t perform that action at this time.
0 commit comments