@mesa-libs/log
v1.1.0
Published
This package is going to use winston to log messages in cloud watch
Downloads
7
Readme
Log Manager
Description
This library have to be used in backend projects to write logs in cloud watch using the same log library (winston). It is going to standardize all project logs.
How it works?
This library exports only one class with static methods, so the only thing you have to do is import the class and call its methods.
Setting up a context
This method set up the context to be used in log messages.
import { LogManager } from '@mesa-libs/log';
LogManager.setContext('context_name');
Logging a INFO message
This method logs a message and metadata. It should be used to information logs in the code.
import { LogManager } from '@mesa-libs/log';
LogManager.info('message');
Logging a WARN message
This method logs a message and metadata. It should be used to warning logs in the code.
import { LogManager } from '@mesa-libs/log';
LogManager.warn('message');
Logging a ERROR message
This method logs a message and metadata. It should be used to error logs in the code.
import { LogManager } from '@mesa-libs/log';
LogManager.error('message');
Logging a DEBUG message
This method logs a message and metadata. It should be used to debug logs in the code.
import { LogManager } from '@mesa-libs/log';
LogManager.debug('message');