bluejamesbond/Scribe.js — pull request #15 by guillaumewuip (2014-12-20 17:49:18+00:00)
Title: Scribe.js 2.0.0 beta

Hi @bluejamesbond !

As [promised](https://github.com/bluejamesbond/Scribe.js/pull/13#issuecomment-55308485), I've worked quite a lot on Scribe.js on my free time since I've discovered the project.

Here's is a PR sharing with you my work. I think of it as the V2 of ScribeJS since a lot of things have changed and all the code has been refactored. My moto was to follow your philosophy and the ideas of the V1.

TL;DR : see my [README](https://github.com/guillaumewuip/Scribe.js/blob/dev/README.md)

**Console2**

Instead of overriding nodejs console functions, I've built a new console from scratch and I've named it *Console2*. It allows us to use constructors logic and so to chain functions like this :

```javascript
console.tag("My tag").time().file().log("My message")
//or in a hury
console.t("My tag").time().f().log("My message")
```

But, before all, you need to create the new Console2 instance. So, you have to do the following in order to have your new console operational :

```javascript
var scribe = require('scribe')();
var console = scribe.console(/* pass options if you want */);
```
So, with just this line, you can use a brand new console instead of the old NodeJS one and keep using the `console` keyword. Of course you can still use colorsjs for your messages.
See also the "[Using Scribe through your modules](https://github.com/guillaumewuip/Scribe.js/blob/dev/README.md#using-scribe-through-your-modules)" part of the README.

**WebPanel**
I've work on the web panel too. A GIF worths 1000 words :
![webPanel demo](https://rawgit.com/guillaumewuip/Scribe.js/dev/__misc/webPanelDemo.gif)
Notice that it answers #5 (view all logs at once).

**ExpressLogger**
The express logger hasn't change a lot.

**LogWriter**
I've put all the save-in-files logic in a LogWriter object. There is a big change (maybe the biggest) : I know save logs in JSON. I've switch to JSON as it's much more suitable for the WebPanel. I also thought that, with a modular system like Scribe.js v2 is becoming, people could build CLI tools to print logs file in a human-readable format it they don't want to use the WebPanel.

Please tell me what you think of my work. I'm quite excited as I think the v2 managed to keep your ideas of a lightweight NodeJS logging while becoming more modular and more maintainable. I've also try to rigorously write doc, comments and [examples](https://github.com/guillaumewuip/Scribe.js/tree/dev/examples).

I really think Scribe.js has killer features that the NodeJS world could appreciate (keep `console` keyword, chaining functions, pretty console logging, the webPanel, events, no db).

PS : please excuse my grammar as I'm not english-native.