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 createdvar log = ; // adds the git middleware to your logging stacklog; // log stuffs, git sha will be added automatically for youlog;
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.