-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add debugging logs control (#467)
* feat: add debugging controls for logs * docs: format Readme file * chore: make debug control optional * chore: update docs * chore: format files * chore: update docs * chore: add color formatting and severity level notice logging. * chore: update debug docs with example * chore: update readme doc
- Loading branch information
1 parent
08320fa
commit 698360d
Showing
7 changed files
with
177 additions
and
18 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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Controls debugging behavior. If set to `true`, all debug options are enabled. | ||
* If set to `false`, all debug options are disabled. Can also be an object with | ||
* specific debug options to enable. | ||
* | ||
* {@default false} | ||
*/ | ||
export type DebugControls = DebugOptions | boolean; | ||
|
||
type DebugOptions = { | ||
/** Log queries */ | ||
queries?: boolean; | ||
/** Log INFO, NOTICE, and WARNING raised database messages */ | ||
notices?: boolean; | ||
/** Log results */ | ||
results?: boolean; | ||
}; | ||
|
||
export const isDebugOptionEnabled = ( | ||
option: keyof DebugOptions, | ||
options?: DebugControls, | ||
): boolean => { | ||
if (typeof options === "boolean") { | ||
return options; | ||
} | ||
|
||
return !!options?.[option]; | ||
}; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
698360d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No typecheck tests failure
This error was most likely caused by incorrect type stripping from the SWC crate
Please report the following failure to https://github.com/denoland/deno with a reproduction of the current commit
Failure log