Socket
Book a DemoInstallSign in
Socket

eleventh

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eleventh

A simple JavaScript logger for writing messages to the standard output, written in TypeScript

1.1.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

eleventh

A simple JavaScript logger for writing messages to the standard output, written in TypeScript

Using eleventh

First, install the package:

npm install eleventh --save

Next, import the package into your project and start logging:

// Import the package with the "CommonJS" syntax:
const Logger = require('eleventh');

// Or, import it with the "ES Modules" syntax:
import Logger from 'eleventh';

// Set the log level (the log level can also be detected from an environment
// variable; see the API docs):
Logger.setLogLevel('debug');

// For the lowest level messages that can be useful in debugging and exceedingly
// noisy otherwise, use Logger.debug:
Logger.debug('Skipping authentication check because user is a guest');
// [2021-01-21T07:51:43:0076Z] DEBUG: Skipping authentication check because user is a guest

// For generally useful runtime information, use Logger.info:
Logger.info('A connection to the database has been opened successfully');
// [2021-01-21T07:51:43:0083Z] INFO: A connection to the database has been opened successfully

// For atypical events which require attention and have the potential to result
// in problems, use Logger.warning:
Logger.warning('Memory usage is exceeding 50%');
// [2021-01-21T07:51:43:0085Z] WARNING: Memory usage is exceeding 50%

// For critical problems that are likely to affect functionality but allow the
// application to continue running, use Logger.error:
Logger.error('Unable to parse the JSON response from the authentication API');
// [2021-01-21T07:51:43:0086Z] ERROR: Unable to parse the JSON response from the authentication API

// For errors which have not been handled and result in the application being
// forced to shut down, use Logger.fatal:
Logger.fatal('Unhandled exception from the file system');
// [2021-01-21T07:51:43:0088Z] FATAL: Unhandled exception from the file system

// Optionally, a record of strings, numbers, and booleans (null and undefined
// are also accepted) can be provided and appended to the log.
Logger.info('Request has completed', { requestId: 'abc123', httpStatus: 200 });
// [2021-01-21T07:51:43:0083Z] INFO: Request has completed requestId="abc123" httpStatus=200

Versioning

This project adheres to Semantic Versioning.

API

This project's API is specified in the API document.

Contributing

This project is open for pull requests. Please refer to CONTRIBUTING.md for information about developing eleventh and submitting changes.

Issues

Please feel welcome to submit an issue for any problems or suggestions you may have regarding eleventh.

License

This project is licensed under the Unlicense. For the full license text, please see LICENSE.

Keywords

eleventh

FAQs

Package last updated on 07 Apr 2022

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.