🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

book-git

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

book-git

git middleware for book logging framework

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
10
150%
Maintainers
1
Weekly downloads
 
Created
Source

book-git is a git version middleware for the book logging framework. It will add a commit field with the sha hash of your projects git repository.

installation

npm install book-git

use

book-git is used like all other book middleware. Just add it to your logger object. I recommend you create a file log.js for your project where you setup the logger however you desire across your entire project.

// some logger you have created
var log = require('book').default();

// adds the git middleware to your logging stack
log.use(require('book-git')());

// log stuffs, git sha will be added automatically for you
log.info('hello world!');

The final log entry will have an additional field commit which will contain the sha hash. If you have a custom book transport, make sure it is writing it to whatever destination you desire. If you use other book transports like book-email or book-file then it will automatically be included in the stored entry.

FAQs

Package last updated on 24 Jan 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