pino/lib/constants.js
obrus-corcentric 384df31c87
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
2024-02-01 15:16:55 +01:00

29 lines
375 B
JavaScript

/**
* 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
}