Socket
Socket
Sign inDemoInstall

mougrim-logger

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mougrim-logger

Mougrim logger


Version published
Maintainers
1
Install size
57.9 kB
Created

Changelog

Source

v0.0.4

There are next changes:

  • add module js-doc (#5)
  • add public/protected js-doc for methods (#5)
  • some small js-doc fixes (#5)
  • add eslint (#6)
  • fix eslint warnings (#6)
  • add package-lock.json to .gitignore (#7)

Readme

Source

This is Mougrim logger library.

Main theme - light and fast library, with simple configuring.

Latest Stable Version

Configuration

import Logger from 'mougrim-logger';

Logger.configure({
    defaultLoggerConfig: {
        minLevel: Logger.LEVEL_NOTICE,
    },
    loggers: {
        foo: {
            maxLevel: Logger.LEVEL_NOTICE,
        },
        bar: {
            minLevel: Logger.LEVEL_INFO,
            maxLevel: Logger.LEVEL_NOTICE,
        }
    },
});

Logging

import Logger from 'mougrim-logger';

let logger = Logger.getLogger('foo'); // minLevel will be from default config, maxLevel will be from loggers config
logger.debug('debug message', {foo: 'bar'}); // will be skipped
logger.info('info message', {foo: 'bar'}); // will be skipped
logger.notice('notice message', {foo: 'bar'}); // will be logged
logger.warning('warning message', {foo: 'bar'}); // will be skipped
logger.error('error message', {foo: 'bar'}); // will be skipped
logger.critical('critical message', {foo: 'bar'}); // will be skipped

logger = Logger.getLogger('bar'); // minLevel and maxLevel will be from loggers config
logger.debug('debug message', {foo: 'bar'}); // will be skipped
logger.info('info message', {foo: 'bar'}); // will be logged
logger.notice('notice message', {foo: 'bar'}); // will be logged
logger.warning('warning message', {foo: 'bar'}); // will be skipped
logger.error('error message', {foo: 'bar'}); // will be skipped
logger.critical('critical message', {foo: 'bar'}); // will be skipped

logger = Logger.getLogger('baz'); // default config will be used
logger.debug('debug message', {foo: 'bar'}); // will be skipped
logger.info('info message', {foo: 'bar'}); // will be skipped
logger.notice('notice message', {foo: 'bar'}); // will be logged
logger.warning('warning message', {foo: 'bar'}); // will be logged
logger.error('error message', {foo: 'bar'}); // will be logged
logger.critical('critical message', {foo: 'bar'}); // will be logged

Keywords

FAQs

Last updated on 08 Feb 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc