-
Notifications
You must be signed in to change notification settings - Fork 878
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to override custom levels comparison (#1883)
* feat: add ability to override custom levels compare * fix: use function instead of closure * docs: update level comparison to docs * test: update types tests for level comparison * refactor: move default levels and sorting order to constants * fix: made suggested changes in pr review * fix: change enum annotation type
- Loading branch information
1 parent
fdd0fd9
commit 384df31
Showing
9 changed files
with
330 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Represents default log level values | ||
* | ||
* @enum {number} | ||
*/ | ||
const DEFAULT_LEVELS = { | ||
trace: 10, | ||
debug: 20, | ||
info: 30, | ||
warn: 40, | ||
error: 50, | ||
fatal: 60 | ||
} | ||
|
||
/** | ||
* Represents sort order direction: `ascending` or `descending` | ||
* | ||
* @enum {string} | ||
*/ | ||
const SORTING_ORDER = { | ||
ASC: 'ASC', | ||
DESC: 'DESC' | ||
} | ||
|
||
module.exports = { | ||
DEFAULT_LEVELS, | ||
SORTING_ORDER | ||
} |
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
Oops, something went wrong.