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

scrib-local

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scrib-local

An adapter for Scrib for writing local log file

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-60%
Maintainers
1
Weekly downloads
 
Created
Source

Scrib-local

An adapter for Scrib to write logs into a log file.

npm install scrib scrib-local --save
var Scrib = require("scrib"),
    logger = new Scrib({
        "local": {
            file: "./data/log.txt",
            filter: function(message) {
                // Messages with a priority lower or equal 0 won't be logged
                return message.priority > 0;
            }
        }
    }, function(e) {
        if(e) throw e;
        
        logger.put("Message", { 42: true }, 3, "MSG", "Logs");
        logger.put("Message2", { node: "up" }, 1, "MSG_2", "Logs");
        
    });

Then your log file will look like (you can modify it using the format option):

[Thu, 01 Aug 2013 19:21:41 GMT] 3 MSG (Logs): Message {"42":true}
[Thu, 01 Aug 2013 19:21:41 GMT] 1 MSG_2 (Logs): Message2 {"node":"up"}

Options

  • file: A path relative to your current file to the log file
  • flags = "a+": File flags to open file with
  • filter = null: A function called with every message to filter them
  • format = null: A function called with every filtered message to return a string to write to the file

Testing Build Status

git clone git://github.com/Acconut/scrib-local.git
cd scrib-local
npm install
npm test

Licensed under the MIT License.

FAQs

Package last updated on 03 Aug 2013

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