@taglivros/tag-logger
TypeScript icon, indicating that this package has built-in type declarations

1.7.0 • Public • Published

tag-logger

Wrapper for winston logger with some default configuration for TAG.

Usage

  1. Install in your project:
  npm i @taglivros/tag-logger
  1. 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 is info.
  • appName: Adds the name of your application to the log.

Build and publish

To build the types use:

npm run build-types

Check if the types are correct and commit to the repository.

To publish use the custom pipeline.

Readme

Keywords

none

Package Sidebar

Install

npm i @taglivros/tag-logger

Weekly Downloads

28

Version

1.7.0

License

ISC

Unpacked Size

3.32 kB

Total Files

6

Last publish

Collaborators

  • taglivrosti