No description
Find a file
2014-05-19 03:10:54 -05:00
__misc Adding sample images 2014-01-23 17:28:14 -06:00
src Adding required html file 2014-05-19 03:05:33 -05:00
.gitattributes Initial push 2014-01-23 17:17:54 -06:00
.gitignore Initial push 2014-01-23 17:17:54 -06:00
LICENSE Initial push 2014-01-23 17:17:54 -06:00
README.md Update README.md 2014-05-19 03:10:54 -05:00

![Logo](__misc/scribejs design logo [a].png)

Lightweight NodeJS Logging Overview

Unlike many of the libraries out there, Scribe.js allows logging on multiple files and is divided into folders by date. And it is possibly the easiest logging you can implement. And it does everything you need a basic logger to do.

  • Save messages into log files organized by user, date, and type
  • Print messages into console using colors indicating level of importance

Sample

Web Control Panel - Select Date

Control Panel View 1 Web Control Panel - Select Log Type

Control Panel View 1 Web Control Panel - View Logs

Control Panel View 1 Output to Console

Command Prompt output Directory template

Files Directory Output to File

Files output

How to use Scribe.js

Using Sribe is as simple as putting the contents of the Scribe folder into your root NodeJS folder. Note: What I am about to show you is the simplest way to use Scribe.js. Since this library (if you can even call it that), is not insave at all, and it should be very easy to adjust to your liking.

  1. Make a Scribe directory

\root
    \node_modules
    \views
    \controllers
    \bunchOfOtherFolder...
    \scribe <--- Make a folder named "scribe"
    app.js
  1. Add Scribe into this folder

\scribe <--- Copy the contents of the "src" folder (which you get from this repo) into "scribe".
  1. Add Scribe into the app.js

var scribe = require('./scribe');  <---- On the very top of your application.
  1. Install the required modules

npm install colors
npm install moment
npm install mkdirp
  1. Logging with Scribe

// You can use any of the following anywhere Scribe will
// both SAVE to file and PRINT to console whatever
console.log("[Tagname]Simple message");
console.info("[Tagname]Simple message");
console.warn("[Tagname]Simple message");
console.error("[Tagname]Simple message");
console.realtime("[Tagname]Simple message");
console.high("[Tagname]Simple message");
console.normal("[Tagname]Simple message");
console.low("[Tagname]Simple message");
  1. Using Scribe and Express

// Inside app.js
app.configure(function () {
    app.use(scribe.logger);
}

Contributors

bluejamesbond