New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

raptor-logging

Package Overview
Dependencies
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raptor-logging

Module to support the optimized delivery of web application resources

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
increased by15.79%
Maintainers
3
Weekly downloads
 
Created
Source

raptor-logging

Super simple logging system that works on the server and and in the browser.

Example

projects/logging-test/run.js:

require('raptor-logging').configure({
    loggers: {
        'ROOT': 'WARN',
        'logging-test': 'DEBUG'
    }
});

// ...

var logger = require('raptor-logging').logger(module);
logger.debug('This is a debug message');

Output:

DEBUG logging-test/run: This is a debug message

You can also pass multiple arguments, as well as non-String arguments to the logging methods.

For example:

var logger = require('raptor-logging').logger(module);
logger.debug('This is a debug message', {foo: 'bar'});

Output:

DEBUG logging-test/run: This is a debug message { foo: 'bar' }

Installation

npm install raptor-logging --save

API

logger(module)

Returns a new Logger instance whose name is based on the filename associated with the Node.js module object.

Example:

var logger = require('raptor-logging').logger(module);
logger.debug('Hello World');

logger(name)

Returns a new Logger instance with the given name

Example:

var logger = require('raptor-logging').logger('foo');
logger.debug('Hello World');

Output:

DEBUG foo: Hello World

configure(options)

Supported options:

  • loggers: A mapping of logger prefixes to log levels (see below)
  • appenders: An array of appender instances (see ConsoleAppender for an example appender implementation)

Example:

require('raptor-logging').configure({
    'ROOT': 'WARN',
    'foo': 'DEBUG',
    'foo/bar': 'WARN',
});

Logger

Methods:

  • isTraceEnabled() : boolean
  • isDebugEnabled() : boolean
  • isInfoEnabled() : boolean
  • isWarnEnabled() : boolean
  • isErrorEnabled() : boolean
  • isFatalEnabled() : boolean
  • dump(arg1, arg2, ...)
  • trace(arg1, arg2, ...)
  • debug(arg1, arg2, ...)
  • info(arg1, arg2, ...)
  • warn(arg1, arg2, ...)
  • error(arg1, arg2, ...)
  • fatal(arg1, arg2, ...)

Contributors

Contribute

Pull Requests welcome. Please submit Github issues for any feature enhancements, bugs or documentation problems.

License

Apache License v2.0

FAQs

Package last updated on 03 Aug 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc