Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jethro

Package Overview
Dependencies
Maintainers
3
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jethro

Modular logging utility

  • 4.4.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
648
decreased by-18.08%
Maintainers
3
Weekly downloads
 
Created
Source

Jethro npm version npm downloads

Jethro Logger is an all-in-one logging utility designed to give developers the logging tools and flexibility they need within one complete package. It is also designed to be used in cooperation with other tools and transport services.

Compatible with Node >= 8.0.

Deprecation Notice

While Jethro is still functional with node.js 8 onwards, development has halted and more active alternatives exist including Winston which has a similar philosophy and approach to it's API.

Installation

npm i jethro --save

Usage

var logger = require('jethro');

logger('info', 'Testing', 'This is a test message!');

Examples

Console
var Jethro = require('jethro');
var logger = new Jethro();
logger('info', 'Somewhere', 'Something happened...');

// OR

var logger = require('jethro');
logger.info('Somewhere', 'Something happened');

The API

var logger = new Jethro();
logger.log(severity, source, message);
logger.direct({
    source,
    severity,
    message,
    timestamp
});
logger.output({
    source,
    severity,
    message,
    timestamp
});
logger.info(source, message);
logger.transport(source, message);
logger.debug(source, message);
logger.success(source, message);
logger.warn(source, message);
logger.warning(source, message);
logger.error(source, message);
logger.fatal(source, message);

Plugins

Express
var Jethro = require('jethro');
var logger = new Jethro();
var expressLog = new Jethro.Express();
logger.addPlugin('express', expressLog);
app.use(expressLog.input());

// OR

var logger = require('jethro');
logger.addPlugin('express', new Jethro.Express());
app.use(logger.plugins.express.input());

Transports

File logging
var Jethro = require('jethro');
var path = require('path');
var logger = new Jethro();
var jethroFile = new Jethro.File();
jethroFile.setFilePath(path.join(__dirname, 'logs'));
logger.addTransport('file', jethroFile);

Projects using this logger

  • TFL Bot (plug.dj)

Credits

Created and maintained by Sam Mills.

Helped and maintained with Alex.

Suggestions and moral support from xBytez and Matthew!

Special thanks to ReAnna whom without which, version 3+ would not be possible.

License

Licensed under the LGPL-v3 & MIT Licenses

Copyright (C) 2022 Sam Mills.

Licenses: LGPL-v3 AND MIT

Keywords

FAQs

Package last updated on 26 May 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

  • 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