1.7.0 • Published 2 years ago
@taglivros/tag-logger v1.7.0
tag-logger
Wrapper for winston logger with some default configuration for TAG.
Usage
- Install in your project:
npm i @taglivros/tag-logger- Import and create a log
const createLogger = require( '@taglivros/tag-logger' )
const logger = createLogger( 'module name', { appName: 'application name (optional)', logLevel: 'info' } )
logger.info('log message') // log message
logger.info('log message with metadata', {someData: 'some metadata here'}) /*
log message with metadata
{"someData": 'some metadata here'}
*/createLogger( moduleName, config )
The createLogger receives two parameters the moduleName and an optional config object.
Configurations:
logLevel: Restricts the level of logs to be output. Default isinfo.appName: Adds the name of your application to the log.
Build and publish
To build the types use:
npm run build-typesCheck if the types are correct and commit to the repository.
To publish use the custom pipeline.