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

elecpen

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elecpen

a simple logger

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-72.73%
Maintainers
1
Weekly downloads
 
Created
Source

ElecPen

Build Status

We take logger as a function to receive a record and output to a stream, and elecPen is a simple logger creator.

API

elecPen(writable, prefix, dateFormat)

ParamDescription
writableA writable stream for logging
prefixThe prefix of the record
dateFormatDate format for logger or pass true to use the default format

Default logger

A set of logger is provided by a default logger creator which provide some useful logger like info or error.

Options

OptionDescription
infoFileFile name for logging info and verbose
errFileFile name for logging error and warning
timestampDate format for logger or pass true to use the default format
appendIf file exists, append new entries to it instead of truncating

Methods

  • logger.verbose
  • logger.info
  • logger.warning
  • logger.error

Example

var opts = {
  infoFile: 'info.log',  // record info and verbose
  errFile: 'err.log', // record error and warning
  logToConsole: true,
  timestamp: true, // default to true
  append: true // default to true
};
var http = requrie('http');
var logger = require('logger').createLogger(opts);

http.createServer(function(req, res) {
  logger.info('Recieve a request. Path: %s', req.path);
  res.end('Hello world.');
})
.listen(4000, function() {
  logger.info('Server listening...');
});

Keywords

FAQs

Package last updated on 09 Jan 2016

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