forked from mirrors/Scribe.js
No description
__misc | ||
src | ||
.gitattributes | ||
.gitignore | ||
LICENSE | ||
README.md |

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 logs
- Print messages into console
Sample
Output to Console
Directory template
Output to File
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.
- Make a Scribe directory
\root
\node_modules
\views
\controllers
\bunchOfOtherFolder...
\scribe <--- Make a folder named "scribe"
app.js
- Add Scribe into this folder
\scribe <--- Copy the contents of the "src" folder (which you get from this repo) into "scribe".
- Add Scribe into the
app.js
var scribe = require('./scribe'); <---- On the very top of your application.
- Install the required modules
npm install colors
npm install moment
npm install mkdirp
- 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");
- Using Scribe and Express
// Inside app.js
app.configure(function () {
app.use(scribe.logger);
}
Contributors
bluejamesbond