-
Notifications
You must be signed in to change notification settings - Fork 0
Logger
/core/Logger
Logger system designed for application feedback. You can use it for logging info about app runtime problems or debug info. It automatically saves log messages into database.
By default all messages will be stored into database for cluster debug. But if it is not necessary to store log message you can turn off database sync for selected messages.
Each message has verbosity parameter which describes the importance of the message. Log viewer can switch verbosity level. If log viewer select verbosity level that higher than message verbosity level - message will be shown.
-
verbosity?: 1 | 2 | 3 | 4
Verbosity level of the message. Used to filter log messages. -
disableDB?: boolean = false
If true, database sync is disabled. Message will not be stored in database.
Logger.info(options?: Logger.Options)(...payload: any[]);
Prints log message to stdout and saves it to database.
Logger.info({verbosity: 1})("Hello", "Darkness", "My", "Old", "Friend");
Logger.info({verbosity: 1, disableDB: true})("Database saving is disabled");
Logger.warn(options?: Logger.Options)(...payload: any[]);
Prints warning message to stdout and saves it to database.
Logger.warn({verbosity: 1})("This is a warning!");
Logger.warn({verbosity: 1, disableDB: true})("Database saving is disabled");
Logger.error(options?: Logger.Options)(...payload: any[]);
Prints error message to stdout and saves it to database.
Logger.error({verbosity: 1})("Error", new TypeError("Incorrect type!"));
Logger.error({verbosity: 1, disableDB: true})("Database saving is disabled");
Copyright Atlas Render | Danil Andreev 2020.