-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve log messages and data (#213)
* feat: improve log messages and data * feat: more logger improvements and log parameter filtering * feat: add more type information for request logger * fix: improve startTime accuracy for request logging * fix: change logger timestamp format to ISO 8601 * style: missing space after const declaration in logger
- Loading branch information
1 parent
6cd3474
commit a8a5406
Showing
38 changed files
with
717 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// @flow | ||
declare module 'ansi-regex' { | ||
declare function ansiregex(): RegExp; | ||
declare var exports: ansiregex; | ||
declare function ansiRegex(): RegExp; | ||
declare var exports: typeof ansiRegex; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
// @flow | ||
declare module 'chalk' { | ||
declare function blue(source: string): string; | ||
declare function cyan(source: string): string; | ||
declare function dim(source: string): string; | ||
declare function green(source: string): string; | ||
declare function magenta(source: string): string; | ||
declare function red(source: string): string; | ||
declare function yellow(source: string): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
// @flow | ||
import { worker, isWorker } from 'cluster'; | ||
|
||
const { env: ENV } = process; | ||
|
||
export const CWD = process.cwd(); | ||
export const PID = (isWorker ? worker : process).pid; | ||
export const PORT = parseInt(ENV.PORT, 10) || 4000; | ||
export const NODE_ENV = ENV.NODE_ENV || 'development'; | ||
export const LUX_CONSOLE = ENV.LUX_CONSOLE || false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// @flow | ||
import type { Logger$level } from './interfaces'; | ||
|
||
export const DEBUG = 'DEBUG'; | ||
export const INFO = 'INFO'; | ||
export const WARN = 'WARN'; | ||
export const ERROR = 'ERROR'; | ||
export const LEVELS: Map<Logger$level, number> = new Map([ | ||
[DEBUG, 0], | ||
[INFO, 1], | ||
[WARN, 2], | ||
[ERROR, 3], | ||
]); |
Oops, something went wrong.