Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote-tracking branch 'origin/query_stream'

Conflicts:
	README.md
	lib/winston/transports/couchdb.js
	lib/winston/transports/webhook.js
	package.json
  • Loading branch information...
commit e42e0fbc15e3eaf14199723a31a5925ceb543fb7 2 parents e55fe5e + 8ddbcff
@chjj chjj authored
Showing with 1,132 additions and 2,247 deletions.
  1. +163 −138 README.md
  2. +0 −194 docs/docco.css
  3. +0 −86 docs/winston.html
  4. +0 −140 docs/winston/common.html
  5. +0 −37 docs/winston/config.html
  6. +0 −37 docs/winston/config/cli-config.html
  7. +0 −29 docs/winston/config/npm-config.html
  8. +0 −33 docs/winston/config/syslog-config.html
  9. +0 −56 docs/winston/exception.html
  10. +0 −344 docs/winston/logger.html
  11. +0 −29 docs/winston/transports.html
  12. +0 −59 docs/winston/transports/console.html
  13. +0 −84 docs/winston/transports/couchdb.html
  14. +0 −211 docs/winston/transports/file.html
  15. +0 −118 docs/winston/transports/loggly.html
  16. +0 −50 docs/winston/transports/transport.html
  17. +0 −82 docs/winston/transports/webhook.html
  18. +2 −0  lib/winston.js
  19. +13 −21 lib/winston/common.js
  20. +162 −9 lib/winston/logger.js
  21. +0 −124 lib/winston/transports/couchdb.js
  22. +259 −23 lib/winston/transports/file.js
  23. +200 −0 lib/winston/transports/http.js
  24. +0 −161 lib/winston/transports/loggly.js
  25. +62 −1 lib/winston/transports/transport.js
  26. +13 −15 lib/winston/transports/webhook.js
  27. +1 −1  package.json
  28. +0 −22 test/helpers.js
  29. +14 −14 test/log-rewriter-test.js
  30. +15 −14 test/logger-test.js
  31. +0 −47 test/transports/couchdb-test.js
  32. +13 −3 test/transports/file-test.js
  33. +0 −61 test/transports/loggly-test.js
  34. +207 −0 test/transports/transport.js
  35. +8 −2 test/transports/webhook-test.js
  36. +0 −2  test/winston-test.js
View
301 README.md
@@ -2,32 +2,43 @@
A multi-transport async logging library for node.js. <span style="font-size:28px; font-weight:bold;">&quot;CHILL WINSTON! ... I put it in the logs.&quot;</span>
-## Installation
-
-### Installing npm (node package manager)
-```
- curl http://npmjs.org/install.sh | sh
-```
-
-### Installing winston
-```
- [sudo] npm install winston
-```
-
## Motivation
-Winston is designed to be a simple and universal logging library with support for multiple transports. A transport is essentially a storage device for your logs. Each instance of a winston logger can have multiple transports configured at different levels. For example, one may want error logs to be stored in a persistent remote location (like a database), but all logs output to the console or a local file.
+Winston is designed to be a simple and universal logging library with support for multiple transports. A transport is essentially a storage device for your logs. Each instance of a winston logger can have multiple transports configured at different levels. For example, one may want error logs to be stored in a persistent remote location (like a database), but all logs output to the console or a local file.
There also seemed to be a lot of logging libraries out there that coupled their implementation of logging (i.e. how the logs are stored / indexed) to the API that they exposed to the programmer. This library aims to decouple those parts of the process to make it more flexible and extensible.
## Usage
-There are two different ways to use winston: directly via the default logger, or by instantiating your own Logger. The former is merely intended to be a convenient shared logger to use throughout your application if you so choose.
+There are two different ways to use winston: directly via the default logger, or by instantiating your own Logger. The former is merely intended to be a convenient shared logger to use throughout your application if you so choose.
+
+* [Logging](#logging)
+ * [Using the Default Logger](#using-the-default-logger)
+ * [Instantiating your own Logger](#instantiating-your-own-logger)
+ * [Logging with Metadata](#logging-with-metadata)
+* [Transports](https://github.com/flatiron/winston/tree/query_stream/docs/transports.md)
+* [Profiling](#profiling)
+* [Streaming Logs](#streaming-logs)
+* [Querying Logs](#querying-logs)
+* [Exceptions](#exceptions)
+ * [Handling Uncaught Exceptions with winston](#handling-uncaught-exceptions-with-winston)
+ * [To Exit or Not to Exit](#to-exit-or-not-to-exit)
+* [Logging Levels](#logging-levels)
+ * [Using Logging Levels](#using-logging-levels)
+ * [Using Custom Logging Levels](#using-custom-logging-levels)
+* [Further Reading](#further-reading)
+ * [Events and Callbacks in Winston](#events-and-callbacks-in-winston)
+ * [Working with multiple Loggers in winston](#working-with-multiple-loggers-in-winston)
+ * [Using winston in a CLI tool](#using-winston-in-a-cli-tool)
+ * [Extending another object with Logging](#extending-another-object-with-logging)
+ * [Adding Custom Transports](#adding-custom-transports)
+
+## Logging
### Using the Default Logger
The default logger is accessible through the winston module directly. Any method that you could call on an instance of a logger is available on the default logger:
``` js
var winston = require('winston');
-
+
winston.log('info', 'Hello distributed log files!');
winston.info('Hello again distributed logs');
```
@@ -39,7 +50,7 @@ By default, only the Console transport is set on the default logger. You can add
winston.remove(winston.transports.Console);
```
-For more documenation about working with each individual transport supported by Winston see the "Working with Transports" section below.
+For more documenation about working with each individual transport supported by Winston see the "Working with Transports" section below.
### Instantiating your own Logger
If you would prefer to manage the object lifetime of loggers you are free to instantiate them yourself:
@@ -53,7 +64,7 @@ If you would prefer to manage the object lifetime of loggers you are free to ins
});
```
-You can work with this logger in the same way that you work with the default logger:
+You can work with this logger in the same way that you work with the default logger:
``` js
//
@@ -61,7 +72,7 @@ You can work with this logger in the same way that you work with the default log
//
logger.log('info', 'Hello distributed log files!');
logger.info('Hello again distributed logs');
-
+
//
// Adding / Removing Transports
// (Yes It's chainable)
@@ -70,6 +81,76 @@ You can work with this logger in the same way that you work with the default log
.remove(winston.transports.Console);
```
+### Logging with Metadata
+In addition to logging string messages, winston will also optionally log additional JSON metadata objects. Adding metadata is simple:
+
+``` js
+ winston.log('info', 'Test Log Message', { anything: 'This is metadata' });
+```
+
+The way these objects is stored varies from transport to transport (to best support the storage mechanisms offered). Here's a quick summary of how each transports handles metadata:
+
+1. __Console:__ Logged via util.inspect(meta)
+2. __File:__ Logged via util.inspect(meta)
+
+## Profiling
+In addition to logging messages and metadata, winston also has a simple profiling mechanism implemented for any logger:
+
+``` js
+ //
+ // Start profile of 'test'
+ // Remark: Consider using Date.now() with async operations
+ //
+ winston.profile('test');
+
+ setTimeout(function () {
+ //
+ // Stop profile of 'test'. Logging will now take place:
+ // "17 Jan 21:00:00 - info: test duration=1000ms"
+ //
+ winston.profile('test');
+ }, 1000);
+```
+
+All profile messages are set to the 'info' by default and both message and metadata are optional There are no plans in the Roadmap to make this configurable, but I'm open to suggestions / issues.
+
+
+## Querying Logs
+Winston supports querying of logs with Loggly-like options.
+Specifically: `File`, `Couchdb`, `Redis`, `Loggly`, `Nssocket`, and `Http`.
+
+``` js
+ var options = {
+ from: new Date - 24 * 60 * 60 * 1000,
+ until: new Date
+ };
+
+ //
+ // Find items logged between today and yesterday.
+ //
+ winston.query(options, function (err, results) {
+ if (err) {
+ throw err;
+ }
+
+ console.log(results);
+ });
+```
+
+## Streaming Logs
+Streaming allows you to stream your logs back from your chosen transport.
+
+``` js
+ //
+ // Start at the end.
+ //
+ winston.stream({ start: -1 }).on('log', function(log) {
+ console.log(log);
+ });
+```
+
+## Exceptions
+
### Handling Uncaught Exceptions with winston
With `winston`, it is possible to catch and log `uncaughtException` events from your process. There are two distinct ways of enabling this functionality either through the default winston logger or your own logger instance.
@@ -81,17 +162,17 @@ If you want to use this feature with the default logger simply call `.handleExce
// You can add a separate exception logger by passing it to `.handleExceptions`
//
winston.handleExceptions(new winston.transports.File({ filename: 'path/to/exceptions.log' }))
-
+
//
// Alternatively you can set `.handleExceptions` to true when adding transports to winston
//
- winston.add(winston.transports.File, {
- filename: 'path/to/all-logs.log',
- handleExceptions: true
+ winston.add(winston.transports.File, {
+ filename: 'path/to/all-logs.log',
+ handleExceptions: true
});
```
-## to exit or not to exit
+### To Exit or Not to Exit
by default, winston will exit after logging an uncaughtException. if this is not the behavior you want,
set `exitOnError = false`
@@ -133,8 +214,10 @@ The `exitOnError` option can also be a function to prevent exit on only certain
logger.exitOnError = ignoreEpipe;
```
+## Logging Levels
+
### Using Logging Levels
-Setting the level for your logging message can be accomplished in one of two ways. You can pass a string representing the logging level to the log() method or use the level specified methods defined on every winston Logger.
+Setting the level for your logging message can be accomplished in one of two ways. You can pass a string representing the logging level to the log() method or use the level specified methods defined on every winston Logger.
``` js
//
@@ -142,7 +225,7 @@ Setting the level for your logging message can be accomplished in one of two way
//
logger.log('info', "127.0.0.1 - there's no place like home");
logger.info("127.0.0.1 - there's no place like home");
-
+
//
// Default logger
//
@@ -168,7 +251,7 @@ As of 0.2.0, winston supports customizable logging levels, defaulting to [npm][0
// Change levels on the default winston logger
//
winston.setLevels(winston.config.syslog.levels);
-
+
//
// Change levels on an instance of a logger
//
@@ -179,7 +262,7 @@ Calling `.setLevels` on a logger will remove all of the previous helper methods
``` js
//
- // Logger does not have 'silly' defined since that level is not in the syslog levels
+ // Logger does not have 'silly' defined since that level is not in the syslog levels
//
logger.silly('some silly message');
```
@@ -202,8 +285,8 @@ In addition to the predefined `npm` and `syslog` levels available in Winston, yo
foobar: 'red'
}
};
-
- var customLevelLogger = new (winston.Logger)({ levels: myCustomLevels.levels });
+
+ var customLevelLogger = new (winston.Logger)({ levels: myCustomLevels.levels });
customLevelLogger.foobar('some foobar level-ed message');
```
@@ -218,6 +301,8 @@ Although there is slight repetition in this data structure, it enables simple en
This enables transports with the 'colorize' option set to appropriately color the output of custom levels.
+## Further Reading
+
### Events and Callbacks in Winston
Each instance of winston.Logger is also an instance of an [EventEmitter][1]. A log event will be raised each time a transport successfully logs a message:
@@ -225,7 +310,7 @@ Each instance of winston.Logger is also an instance of an [EventEmitter][1]. A l
logger.on('logging', function (transport, level, msg, meta) {
// [msg] and [meta] have now been logged at [level] to [transport]
});
-
+
logger.info('CHILL WINSTON!', { seriously: true });
```
@@ -236,7 +321,7 @@ It is also worth mentioning that the logger also emits an 'error' event which yo
// Handle errors
//
logger.on('error', function (err) { /* Do Something */ });
-
+
//
// Or just suppress them.
//
@@ -257,7 +342,7 @@ Often in larger, more complex applications it is necessary to have multiple logg
``` js
var winston = require('winston');
-
+
//
// Configure the logger for `category1`
//
@@ -270,7 +355,7 @@ Often in larger, more complex applications it is necessary to have multiple logg
filename: '/path/to/some/file'
}
});
-
+
//
// Configure the logger for `category2`
//
@@ -286,12 +371,12 @@ Now that your loggers are setup you can require winston _in any file in your app
``` js
var winston = require('winston');
-
+
//
// Grab your preconfigured logger
//
var category1 = winston.loggers.get('category1');
-
+
category1.info('logging from your IoC container-based logger');
```
@@ -300,7 +385,7 @@ If you prefer to manage the `Container` yourself you can simply instantiate one:
``` js
var winston = require('winston'),
container = new winston.Container();
-
+
container.add('category1', {
console: {
level: 'silly',
@@ -323,7 +408,7 @@ If you prefer to manage the `Container` yourself you can simply instantiate one:
//
// 1. By setting it on the default Container
// 2. By passing `transports` into the constructor function of winston.Container
- // 3. By passing `transports` into the `.get()` or `.add()` methods
+ // 3. By passing `transports` into the `.get()` or `.add()` methods
//
//
@@ -343,8 +428,8 @@ If you prefer to manage the `Container` yourself you can simply instantiate one:
});
//
- // 3. By passing `transports` into the `.get()` or `.add()` methods
- //
+ // 3. By passing `transports` into the `.get()` or `.add()` methods
+ //
winston.loggers.add('some-category', {
transports: [
// Setup your shared transports here
@@ -358,42 +443,8 @@ If you prefer to manage the `Container` yourself you can simply instantiate one:
});
```
-### Logging with Metadata
-In addition to logging string messages, winston will also optionally log additional JSON metadata objects. Adding metadata is simple:
-
-``` js
- winston.log('info', 'Test Log Message', { anything: 'This is metadata' });
-```
-
-The way these objects is stored varies from transport to transport (to best support the storage mechanisms offered). Here's a quick summary of how each transports handles metadata:
-
-1. __Console:__ Logged via util.inspect(meta)
-2. __File:__ Logged via util.inspect(meta)
-3. __Loggly:__ Logged in suggested [Loggly format][2]
-
-### Profiling with Winston
-In addition to logging messages and metadata, winston also has a simple profiling mechanism implemented for any logger:
-
-``` js
- //
- // Start profile of 'test'
- // Remark: Consider using Date.now() with async operations
- //
- winston.profile('test');
-
- setTimeout(function () {
- //
- // Stop profile of 'test'. Logging will now take place:
- // "17 Jan 21:00:00 - info: test duration=1000ms"
- //
- winston.profile('test');
- }, 1000);
-```
-
-All profile messages are set to the 'info' by default and both message and metadata are optional There are no plans in the Roadmap to make this configurable, but I'm open to suggestions / issues.
-
### Using winston in a CLI tool
-A common use-case for logging is output to a CLI tool. Winston has a special helper method which will pretty print output from your CLI tool. Here's an example from the [require-analyzer][15] written by [Nodejitsu][5]:
+A common use-case for logging is output to a CLI tool. Winston has a special helper method which will pretty print output from your CLI tool. Here's an example from the [require-analyzer][2] written by [Nodejitsu][3]:
```
info: require-analyzer starting in /Users/Charlie/Nodejitsu/require-analyzer
@@ -417,12 +468,12 @@ Configuring output for this style is easy, just use the `.cli()` method on `wins
``` js
var winston = require('winston');
-
+
//
// Configure CLI output on the default logger
//
winston.cli();
-
+
//
// Configure CLI on an instance of winston.Logger
//
@@ -431,18 +482,18 @@ Configuring output for this style is easy, just use the `.cli()` method on `wins
new (winston.transports.Console)()
]
});
-
+
logger.cli();
```
-### Extending another object with Logging functionality
+### Extending another object with Logging
Often in a given code base with lots of Loggers it is useful to add logging methods a different object so that these methods can be called with less syntax. Winston exposes this functionality via the 'extend' method:
``` js
var myObject = {};
-
+
logger.extend(myObject);
-
+
//
// You can now call logger methods on 'myObject'
//
@@ -644,76 +695,63 @@ Adding a custom transport (say for one of the datastore on the Roadmap) is actua
``` js
var util = require('util'),
winston = require('winston');
-
+
var CustomLogger = winston.transports.CustomerLogger = function (options) {
//
// Name this logger
//
this.name = 'customLogger';
-
+
//
// Set the level from your options
//
this.level = options.level || 'info';
-
+
//
// Configure your storage backing as you see fit
//
};
-
+
//
// Inherit from `winston.Transport` so you can take advantage
// of the base functionality and `.handleExceptions()`.
//
util.inherits(CustomLogger, winston.Transport);
-
+
CustomLogger.prototype.log = function (level, msg, meta, callback) {
//
// Store this message and metadata, maybe use some custom logic
// then callback indicating success.
//
- callback(null, true);
+ callback(null, true);
};
```
-## What's Next?
-Winston is stable and under active development. It is supported by and used at [Nodejitsu][5].
-
### Inspirations
1. [npm][0]
-2. [log.js][9]
-3. [socket.io][10]
-4. [node-rlog][11]
-5. [BigBrother][12]
-6. [Loggly][7]
+2. [log.js][4]
+3. [socket.io][5]
+4. [node-rlog][6]
+5. [BigBrother][7]
+6. [Loggly][8]
-### Road Map
-1. Improve support for adding custom Transports not defined in Winston core.
-2. Create API for reading from logs across all transports.
-3. Add more transports: Redis
+## Installation
-## Run Tests
-All of the winston tests are written in [vows][13], and cover all of the use cases described above. You will need to add valid credentials for the various transports included to test/fixtures/test-config.json before running tests:
-
-``` js
- {
- "transports": {
- "loggly": {
- "subdomain": "your-subdomain",
- "inputToken": "really-long-token-you-got-from-loggly",
- "auth": {
- "username": "your-username",
- "password": "your-password"
- }
- }
- }
- }
+### Installing npm (node package manager)
+```
+ curl http://npmjs.org/install.sh | sh
```
-Once you have valid configuration and credentials you can run tests with [vows][13]:
-
+### Installing winston
```
- vows --spec --isolate
+ [sudo] npm install winston
+```
+
+## Run Tests
+All of the winston tests are written in [vows][9], and designed to be run with npm.
+
+``` bash
+ $ npm test
```
#### Author: [Charlie Robbins](http://twitter.com/indexzero)
@@ -721,24 +759,11 @@ Once you have valid configuration and credentials you can run tests with [vows][
[0]: https://github.com/isaacs/npm/blob/master/lib/utils/log.js
[1]: http://nodejs.org/docs/v0.3.5/api/events.html#events.EventEmitter
-[2]: http://wiki.loggly.com/loggingfromcode
-[3]: http://riakjs.org
-[4]: https://github.com/frank06/riak-js/blob/master/src/http_client.coffee#L10
-[5]: http://nodejitsu.com
-[6]: http://github.com/nodejitsu/node-loggly
-[7]: http://loggly.com
-[8]: http://www.loggly.com/product/
-[9]: https://github.com/visionmedia/log.js
-[10]: http://socket.io
-[11]: https://github.com/jbrisbin/node-rlog
-[12]: https://github.com/feisty/BigBrother
-[13]: http://vowsjs.org
-[14]: http://nodejs.org/docs/v0.3.5/api/streams.html#writable_Stream
-[15]: http://github.com/nodejitsu/require-analyzer
-[16]: http://github.com/indexzero/winston-mongodb
-[17]: http://github.com/indexzero/winston-riak
-[18]: http://github.com/appsattic/winston-simpledb
-[19]: http://github.com/wavded/winston-mail
-[20]: https://github.com/weaver/node-mail
-[21]: https://github.com/jesseditson/winston-sns
-[22]: https://github.com/flite/winston-graylog2
+[2]: http://github.com/nodejitsu/require-analyzer
+[3]: http://nodejitsu.com
+[4]: https://github.com/visionmedia/log.js
+[5]: http://socket.io
+[6]: https://github.com/jbrisbin/node-rlog
+[7]: https://github.com/feisty/BigBrother
+[8]: http://loggly.com
+[9]: http://vowsjs.org
View
194 docs/docco.css
@@ -1,194 +0,0 @@
-/*--------------------- Layout and Typography ----------------------------*/
-body {
- font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
- font-size: 15px;
- line-height: 22px;
- color: #252519;
- margin: 0; padding: 0;
-}
-a {
- color: #261a3b;
-}
- a:visited {
- color: #261a3b;
- }
-p {
- margin: 0 0 15px 0;
-}
-h4, h5, h6 {
- color: #333;
- margin: 6px 0 6px 0;
- font-size: 13px;
-}
- h2, h3 {
- margin-bottom: 0;
- color: #000;
- }
- h1 {
- margin-top: 40px;
- margin-bottom: 15px;
- color: #000;
- }
-#container {
- position: relative;
-}
-#background {
- position: fixed;
- top: 0; left: 525px; right: 0; bottom: 0;
- background: #f5f5ff;
- border-left: 1px solid #e5e5ee;
- z-index: -1;
-}
-#jump_to, #jump_page {
- background: white;
- -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
- -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
- font: 10px Arial;
- text-transform: uppercase;
- cursor: pointer;
- text-align: right;
-}
-#jump_to, #jump_wrapper {
- position: fixed;
- right: 0; top: 0;
- padding: 5px 10px;
-}
- #jump_wrapper {
- padding: 0;
- display: none;
- }
- #jump_to:hover #jump_wrapper {
- display: block;
- }
- #jump_page {
- padding: 5px 0 3px;
- margin: 0 0 25px 25px;
- }
- #jump_page .source {
- display: block;
- padding: 5px 10px;
- text-decoration: none;
- border-top: 1px solid #eee;
- }
- #jump_page .source:hover {
- background: #f5f5ff;
- }
- #jump_page .source:first-child {
- }
-table td {
- border: 0;
- outline: 0;
-}
- td.docs, th.docs {
- max-width: 450px;
- min-width: 450px;
- min-height: 5px;
- padding: 10px 25px 1px 50px;
- overflow-x: hidden;
- vertical-align: top;
- text-align: left;
- }
- .docs pre {
- margin: 15px 0 15px;
- padding-left: 15px;
- }
- .docs p tt, .docs p code {
- background: #f8f8ff;
- border: 1px solid #dedede;
- font-size: 12px;
- padding: 0 0.2em;
- }
- .pilwrap {
- position: relative;
- }
- .pilcrow {
- font: 12px Arial;
- text-decoration: none;
- color: #454545;
- position: absolute;
- top: 3px; left: -20px;
- padding: 1px 2px;
- opacity: 0;
- -webkit-transition: opacity 0.2s linear;
- }
- td.docs:hover .pilcrow {
- opacity: 1;
- }
- td.code, th.code {
- padding: 14px 15px 16px 25px;
- width: 100%;
- vertical-align: top;
- background: #f5f5ff;
- border-left: 1px solid #e5e5ee;
- }
- pre, tt, code {
- font-size: 12px; line-height: 18px;
- font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
- margin: 0; padding: 0;
- }
-
-
-/*---------------------- Syntax Highlighting -----------------------------*/
-td.linenos { background-color: #f0f0f0; padding-right: 10px; }
-span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
-body .hll { background-color: #ffffcc }
-body .c { color: #408080; font-style: italic } /* Comment */
-body .err { border: 1px solid #FF0000 } /* Error */
-body .k { color: #954121 } /* Keyword */
-body .o { color: #666666 } /* Operator */
-body .cm { color: #408080; font-style: italic } /* Comment.Multiline */
-body .cp { color: #BC7A00 } /* Comment.Preproc */
-body .c1 { color: #408080; font-style: italic } /* Comment.Single */
-body .cs { color: #408080; font-style: italic } /* Comment.Special */
-body .gd { color: #A00000 } /* Generic.Deleted */
-body .ge { font-style: italic } /* Generic.Emph */
-body .gr { color: #FF0000 } /* Generic.Error */
-body .gh { color: #000080; font-weight: bold } /* Generic.Heading */
-body .gi { color: #00A000 } /* Generic.Inserted */
-body .go { color: #808080 } /* Generic.Output */
-body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
-body .gs { font-weight: bold } /* Generic.Strong */
-body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
-body .gt { color: #0040D0 } /* Generic.Traceback */
-body .kc { color: #954121 } /* Keyword.Constant */
-body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */
-body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */
-body .kp { color: #954121 } /* Keyword.Pseudo */
-body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */
-body .kt { color: #B00040 } /* Keyword.Type */
-body .m { color: #666666 } /* Literal.Number */
-body .s { color: #219161 } /* Literal.String */
-body .na { color: #7D9029 } /* Name.Attribute */
-body .nb { color: #954121 } /* Name.Builtin */
-body .nc { color: #0000FF; font-weight: bold } /* Name.Class */
-body .no { color: #880000 } /* Name.Constant */
-body .nd { color: #AA22FF } /* Name.Decorator */
-body .ni { color: #999999; font-weight: bold } /* Name.Entity */
-body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
-body .nf { color: #0000FF } /* Name.Function */
-body .nl { color: #A0A000 } /* Name.Label */
-body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
-body .nt { color: #954121; font-weight: bold } /* Name.Tag */
-body .nv { color: #19469D } /* Name.Variable */
-body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
-body .w { color: #bbbbbb } /* Text.Whitespace */
-body .mf { color: #666666 } /* Literal.Number.Float */
-body .mh { color: #666666 } /* Literal.Number.Hex */
-body .mi { color: #666666 } /* Literal.Number.Integer */
-body .mo { color: #666666 } /* Literal.Number.Oct */
-body .sb { color: #219161 } /* Literal.String.Backtick */
-body .sc { color: #219161 } /* Literal.String.Char */
-body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */
-body .s2 { color: #219161 } /* Literal.String.Double */
-body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
-body .sh { color: #219161 } /* Literal.String.Heredoc */
-body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
-body .sx { color: #954121 } /* Literal.String.Other */
-body .sr { color: #BB6688 } /* Literal.String.Regex */
-body .s1 { color: #219161 } /* Literal.String.Single */
-body .ss { color: #19469D } /* Literal.String.Symbol */
-body .bp { color: #954121 } /* Name.Builtin.Pseudo */
-body .vc { color: #19469D } /* Name.Variable.Class */
-body .vg { color: #19469D } /* Name.Variable.Global */
-body .vi { color: #19469D } /* Name.Variable.Instance */
-body .il { color: #666666 } /* Literal.Number.Integer.Long */
View
86 docs/winston.html
@@ -1,86 +0,0 @@
-<!DOCTYPE html> <html> <head> <title>winston.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="winston/common.html"> winston/common.html </a> <a class="source" href="winston/config/cli-config.html"> winston/config/cli-config.html </a> <a class="source" href="winston/config/npm-config.html"> winston/config/npm-config.html </a> <a class="source" href="winston/config/syslog-config.html"> winston/config/syslog-config.html </a> <a class="source" href="winston/config.html"> winston/config.html </a> <a class="source" href="winston/exception.html"> winston/exception.html </a> <a class="source" href="winston/logger.html"> winston/logger.html </a> <a class="source" href="winston/transports/console.html"> winston/transports/console.html </a> <a class="source" href="winston/transports/couchdb.html"> winston/transports/couchdb.html </a> <a class="source" href="winston/transports/file.html"> winston/transports/file.html </a> <a class="source" href="winston/transports/loggly.html"> winston/transports/loggly.html </a> <a class="source" href="winston/transports/transport.html"> winston/transports/transport.html </a> <a class="source" href="winston/transports/webhook.html"> winston/transports/webhook.html </a> <a class="source" href="winston/transports.html"> winston/transports.html </a> <a class="source" href="winston.html"> winston.html </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> winston.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="cm">/*</span>
-<span class="cm"> * winston.js: Top-level include defining Winston.</span>
-<span class="cm"> *</span>
-<span class="cm"> * (C) 2010 Charlie Robbins</span>
-<span class="cm"> * MIT LICENCE</span>
-<span class="cm"> *</span>
-<span class="cm"> */</span>
-
-<span class="kd">var</span> <span class="nx">winston</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Expose version using <code>pkginfo</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">require</span><span class="p">(</span><span class="s1">&#39;pkginfo&#39;</span><span class="p">)(</span><span class="nx">module</span><span class="p">,</span> <span class="s1">&#39;version&#39;</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Include transports defined by default by winston</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">winston</span><span class="p">.</span><span class="nx">transports</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./winston/transports&#39;</span><span class="p">);</span>
-
-<span class="kd">var</span> <span class="nx">common</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./winston/common&#39;</span><span class="p">);</span>
-<span class="nx">winston</span><span class="p">.</span><span class="nx">hash</span> <span class="o">=</span> <span class="nx">common</span><span class="p">.</span><span class="nx">hash</span><span class="p">;</span>
-<span class="nx">winston</span><span class="p">.</span><span class="nx">clone</span> <span class="o">=</span> <span class="nx">common</span><span class="p">.</span><span class="nx">clone</span><span class="p">;</span>
-<span class="nx">winston</span><span class="p">.</span><span class="nx">longestElement</span> <span class="o">=</span> <span class="nx">common</span><span class="p">.</span><span class="nx">longestElement</span><span class="p">;</span>
-<span class="nx">winston</span><span class="p">.</span><span class="nx">exception</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./winston/exception&#39;</span><span class="p">);</span>
-<span class="nx">winston</span><span class="p">.</span><span class="nx">config</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./winston/config&#39;</span><span class="p">);</span>
-<span class="nx">winston</span><span class="p">.</span><span class="nx">addColors</span> <span class="o">=</span> <span class="nx">winston</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">addColors</span><span class="p">;</span>
-<span class="nx">winston</span><span class="p">.</span><span class="nx">Logger</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./winston/logger&#39;</span><span class="p">).</span><span class="nx">Logger</span><span class="p">;</span>
-<span class="nx">winston</span><span class="p">.</span><span class="nx">Transport</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./winston/transports/transport&#39;</span><span class="p">).</span><span class="nx">Transport</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>We create and expose a 'defaultLogger' so that the programmer may do the
-following without the need to create an instance of winston.Logger directly:</p>
-
-<pre><code>var winston = require('winston');
-winston.log('info', 'some message');
-winston.error('some error');
-</code></pre> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">defaultLogger</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">winston</span><span class="p">.</span><span class="nx">Logger</span><span class="p">({</span>
- <span class="nx">transports</span><span class="o">:</span> <span class="p">[</span><span class="k">new</span> <span class="nx">winston</span><span class="p">.</span><span class="nx">transports</span><span class="p">.</span><span class="nx">Console</span><span class="p">()]</span>
-<span class="p">});</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Pass through the target methods onto `winston.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">methods</span> <span class="o">=</span> <span class="p">[</span>
- <span class="s1">&#39;log&#39;</span><span class="p">,</span>
- <span class="s1">&#39;add&#39;</span><span class="p">,</span>
- <span class="s1">&#39;remove&#39;</span><span class="p">,</span>
- <span class="s1">&#39;profile&#39;</span><span class="p">,</span>
- <span class="s1">&#39;extend&#39;</span><span class="p">,</span>
- <span class="s1">&#39;cli&#39;</span><span class="p">,</span>
- <span class="s1">&#39;handleExceptions&#39;</span><span class="p">,</span>
- <span class="s1">&#39;unhandleExceptions&#39;</span>
-<span class="p">];</span>
-<span class="nx">common</span><span class="p">.</span><span class="nx">setLevels</span><span class="p">(</span><span class="nx">winston</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">defaultLogger</span><span class="p">.</span><span class="nx">levels</span><span class="p">);</span>
-<span class="nx">methods</span><span class="p">.</span><span class="nx">forEach</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">method</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">winston</span><span class="p">[</span><span class="nx">method</span><span class="p">]</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
- <span class="k">return</span> <span class="nx">defaultLogger</span><span class="p">[</span><span class="nx">method</span><span class="p">].</span><span class="nx">apply</span><span class="p">(</span><span class="nx">defaultLogger</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
- <span class="p">};</span>
-<span class="p">});</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <h3>function cli ()</h3>
-
-<p>Configures the default winston logger to have the
-settings for command-line interfaces: no timestamp,
-colors enabled, padded output, and additional levels.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">winston</span><span class="p">.</span><span class="nx">cli</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
- <span class="nx">winston</span><span class="p">.</span><span class="nx">padLevels</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
- <span class="nx">common</span><span class="p">.</span><span class="nx">setLevels</span><span class="p">(</span><span class="nx">winston</span><span class="p">,</span> <span class="nx">defaultLogger</span><span class="p">.</span><span class="nx">levels</span><span class="p">,</span> <span class="nx">winston</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">cli</span><span class="p">.</span><span class="nx">levels</span><span class="p">);</span>
- <span class="nx">defaultLogger</span><span class="p">.</span><span class="nx">setLevels</span><span class="p">(</span><span class="nx">winston</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">cli</span><span class="p">.</span><span class="nx">levels</span><span class="p">);</span>
- <span class="nx">winston</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">addColors</span><span class="p">(</span><span class="nx">winston</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">cli</span><span class="p">.</span><span class="nx">colors</span><span class="p">);</span>
-
- <span class="k">if</span> <span class="p">(</span><span class="nx">defaultLogger</span><span class="p">.</span><span class="nx">transports</span><span class="p">.</span><span class="nx">console</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">defaultLogger</span><span class="p">.</span><span class="nx">transports</span><span class="p">.</span><span class="nx">console</span><span class="p">.</span><span class="nx">colorize</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
- <span class="nx">defaultLogger</span><span class="p">.</span><span class="nx">transports</span><span class="p">.</span><span class="nx">console</span><span class="p">.</span><span class="nx">timestamp</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
- <span class="p">}</span>
-
- <span class="k">return</span> <span class="nx">winston</span><span class="p">;</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <h3>function setLevels (target)</h3>
-
-<h4>@target {Object} Target levels to use</h4>
-
-<p>Sets the <code>target</code> levels specified on the default winston logger.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">winston</span><span class="p">.</span><span class="nx">setLevels</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">target</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">common</span><span class="p">.</span><span class="nx">setLevels</span><span class="p">(</span><span class="nx">winston</span><span class="p">,</span> <span class="nx">defaultLogger</span><span class="p">.</span><span class="nx">levels</span><span class="p">,</span> <span class="nx">target</span><span class="p">);</span>
- <span class="nx">defaultLogger</span><span class="p">.</span><span class="nx">setLevels</span><span class="p">(</span><span class="nx">target</span><span class="p">);</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Define getters / setters for appropriate properties of the
-default logger which need to be exposed by winston.</p> </td> <td class="code"> <div class="highlight"><pre><span class="p">[</span><span class="s1">&#39;emitErrs&#39;</span><span class="p">,</span> <span class="s1">&#39;padLevels&#39;</span><span class="p">,</span> <span class="s1">&#39;levelLength&#39;</span><span class="p">].</span><span class="nx">forEach</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">prop</span><span class="p">)</span> <span class="p">{</span>
- <span class="nb">Object</span><span class="p">.</span><span class="nx">defineProperty</span><span class="p">(</span><span class="nx">winston</span><span class="p">,</span> <span class="nx">prop</span><span class="p">,</span> <span class="p">{</span>
- <span class="nx">get</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
- <span class="k">return</span> <span class="nx">defaultLogger</span><span class="p">[</span><span class="nx">prop</span><span class="p">];</span>
- <span class="p">},</span>
- <span class="nx">set</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">val</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">defaultLogger</span><span class="p">[</span><span class="nx">prop</span><span class="p">]</span> <span class="o">=</span> <span class="nx">val</span><span class="p">;</span>
- <span class="p">}</span>
- <span class="p">});</span>
-<span class="p">});</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>@default {Object}
-The default transports and exceptionHandlers for
-the default winston logger.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nb">Object</span><span class="p">.</span><span class="nx">defineProperty</span><span class="p">(</span><span class="nx">winston</span><span class="p">,</span> <span class="s1">&#39;default&#39;</span><span class="p">,</span> <span class="p">{</span>
- <span class="nx">get</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
- <span class="k">return</span> <span class="p">{</span>
- <span class="nx">transports</span><span class="o">:</span> <span class="nx">defaultLogger</span><span class="p">.</span><span class="nx">transports</span><span class="p">,</span>
- <span class="nx">exceptionHandlers</span><span class="o">:</span> <span class="nx">defaultLogger</span><span class="p">.</span><span class="nx">exceptionHandlers</span>
- <span class="p">};</span>
- <span class="p">}</span>
-<span class="p">});</span>
-
-</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
140 docs/winston/common.html
@@ -1,140 +0,0 @@
-<!DOCTYPE html> <html> <head> <title>common.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="../docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="..//winston/common.html"> winston/common.html </a> <a class="source" href="..//winston/config/cli-config.html"> winston/config/cli-config.html </a> <a class="source" href="..//winston/config/npm-config.html"> winston/config/npm-config.html </a> <a class="source" href="..//winston/config/syslog-config.html"> winston/config/syslog-config.html </a> <a class="source" href="..//winston/config.html"> winston/config.html </a> <a class="source" href="..//winston/exception.html"> winston/exception.html </a> <a class="source" href="..//winston/logger.html"> winston/logger.html </a> <a class="source" href="..//winston/transports/console.html"> winston/transports/console.html </a> <a class="source" href="..//winston/transports/couchdb.html"> winston/transports/couchdb.html </a> <a class="source" href="..//winston/transports/file.html"> winston/transports/file.html </a> <a class="source" href="..//winston/transports/loggly.html"> winston/transports/loggly.html </a> <a class="source" href="..//winston/transports/transport.html"> winston/transports/transport.html </a> <a class="source" href="..//winston/transports/webhook.html"> winston/transports/webhook.html </a> <a class="source" href="..//winston/transports.html"> winston/transports.html </a> <a class="source" href="..//winston.html"> winston.html </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> common.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="cm">/*</span>
-<span class="cm"> * common.js: Internal helper and utility functions for winston</span>
-<span class="cm"> *</span>
-<span class="cm"> * (C) 2010 Charlie Robbins</span>
-<span class="cm"> * MIT LICENCE</span>
-<span class="cm"> *</span>
-<span class="cm"> */</span>
-
-<span class="kd">var</span> <span class="nx">util</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;util&#39;</span><span class="p">),</span>
- <span class="nx">crypto</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;crypto&#39;</span><span class="p">),</span>
- <span class="nx">loggly</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;loggly&#39;</span><span class="p">),</span>
- <span class="nx">config</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./config&#39;</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <h3>function setLevels (target, past, current)</h3>
-
-<h4>@target {Object} Object on which to set levels.</h4>
-
-<h4>@past {Object} Previous levels set on target.</h4>
-
-<h4>@current {Object} Current levels to set on target.</h4>
-
-<p>Create functions on the target objects for each level
-in current.levels. If past is defined, remove functions
-for each of those levels.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">setLevels</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">target</span><span class="p">,</span> <span class="nx">past</span><span class="p">,</span> <span class="nx">current</span><span class="p">,</span> <span class="nx">isDefault</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">if</span> <span class="p">(</span><span class="nx">past</span><span class="p">)</span> <span class="p">{</span>
- <span class="nb">Object</span><span class="p">.</span><span class="nx">keys</span><span class="p">(</span><span class="nx">past</span><span class="p">).</span><span class="nx">forEach</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">level</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">delete</span> <span class="nx">target</span><span class="p">[</span><span class="nx">level</span><span class="p">];</span>
- <span class="p">});</span>
- <span class="p">}</span>
-
- <span class="nx">target</span><span class="p">.</span><span class="nx">levels</span> <span class="o">=</span> <span class="nx">current</span> <span class="o">||</span> <span class="nx">config</span><span class="p">.</span><span class="nx">npm</span><span class="p">.</span><span class="nx">levels</span><span class="p">;</span>
- <span class="k">if</span> <span class="p">(</span><span class="nx">target</span><span class="p">.</span><span class="nx">padLevels</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">target</span><span class="p">.</span><span class="nx">levelLength</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">longestElement</span><span class="p">(</span><span class="nb">Object</span><span class="p">.</span><span class="nx">keys</span><span class="p">(</span><span class="nx">target</span><span class="p">.</span><span class="nx">levels</span><span class="p">));</span>
- <span class="p">}</span>
- </pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Define prototype methods for each log level
- e.g. target.log('info', msg) &lt;=> target.info(msg)</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nb">Object</span><span class="p">.</span><span class="nx">keys</span><span class="p">(</span><span class="nx">target</span><span class="p">.</span><span class="nx">levels</span><span class="p">).</span><span class="nx">forEach</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">level</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">target</span><span class="p">[</span><span class="nx">level</span><span class="p">]</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">msg</span><span class="p">)</span> <span class="p">{</span>
- <span class="kd">var</span> <span class="nx">args</span> <span class="o">=</span> <span class="nb">Array</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">slice</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">arguments</span><span class="p">),</span>
- <span class="nx">callback</span> <span class="o">=</span> <span class="k">typeof</span> <span class="nx">args</span><span class="p">[</span><span class="nx">args</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> <span class="o">===</span> <span class="s1">&#39;function&#39;</span> <span class="o">?</span> <span class="nx">args</span><span class="p">.</span><span class="nx">pop</span><span class="p">()</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
- <span class="nx">meta</span> <span class="o">=</span> <span class="nx">args</span><span class="p">.</span><span class="nx">length</span> <span class="o">===</span> <span class="mi">2</span> <span class="o">?</span> <span class="nx">args</span><span class="p">.</span><span class="nx">pop</span><span class="p">()</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
-
- <span class="k">return</span> <span class="nx">target</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">level</span><span class="p">,</span> <span class="nx">msg</span><span class="p">,</span> <span class="nx">meta</span><span class="p">,</span> <span class="nx">callback</span><span class="p">);</span>
- <span class="p">};</span>
- <span class="p">});</span>
-
- <span class="k">return</span> <span class="nx">target</span><span class="p">;</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <h3>function longestElement</h3>
-
-<h4>@xs {Array} Array to calculate against</h4>
-
-<p>Returns the longest element in the <code>xs</code> array.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">longestElement</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">xs</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span>
- <span class="kc">null</span><span class="p">,</span>
- <span class="nx">xs</span><span class="p">.</span><span class="nx">map</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">x</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="nx">x</span><span class="p">.</span><span class="nx">length</span> <span class="p">})</span>
- <span class="p">);</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <h3>function clone (obj)</h3>
-
-<h4>@obj {Object} Object to clone.</h4>
-
-<p>Helper method for deep cloning pure JSON objects
-i.e. JSON objects that are either literals or objects (no Arrays, etc)</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">clone</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="p">{</span>
- <span class="kd">var</span> <span class="nx">copy</span> <span class="o">=</span> <span class="p">{};</span>
- <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">obj</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">if</span> <span class="p">(</span><span class="nb">Array</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">obj</span><span class="p">[</span><span class="nx">i</span><span class="p">]))</span> <span class="p">{</span>
- <span class="nx">copy</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">obj</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">slice</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
- <span class="p">}</span>
- <span class="k">else</span> <span class="p">{</span>
- <span class="nx">copy</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">obj</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="k">instanceof</span> <span class="nb">Object</span> <span class="o">?</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">clone</span><span class="p">(</span><span class="nx">obj</span><span class="p">[</span><span class="nx">i</span><span class="p">])</span> <span class="o">:</span> <span class="nx">obj</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
- <span class="p">}</span>
- <span class="p">}</span>
-
- <span class="k">return</span> <span class="nx">copy</span><span class="p">;</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <h3>function log (options)</h3>
-
-<h4>@options {Object} All information about the log serialization.</h4>
-
-<p>Generic logging function for returning timestamped strings
-with the following options:</p>
-
-<p>{
- level: 'level to add to serialized message',
- message: 'message to serialize',
- meta: 'additional logging metadata to serialize',
- colorize: false, // Colorizes output (only if <code>.json</code> is false)
- timestamp: true // Adds a timestamp to the serialized message
- }</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">log</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">options</span><span class="p">)</span> <span class="p">{</span>
- <span class="kd">var</span> <span class="nx">timestampFn</span> <span class="o">=</span> <span class="k">typeof</span> <span class="nx">options</span><span class="p">.</span><span class="nx">timestamp</span> <span class="o">===</span> <span class="s1">&#39;function&#39;</span> <span class="o">?</span> <span class="nx">options</span><span class="p">.</span><span class="nx">timestamp</span> <span class="o">:</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">timestamp</span><span class="p">,</span>
- <span class="nx">timestamp</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">timestamp</span> <span class="o">?</span> <span class="nx">timestampFn</span><span class="p">()</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
- <span class="nx">meta</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">meta</span> <span class="o">?</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">clone</span><span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">meta</span><span class="p">)</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
- <span class="nx">output</span><span class="p">;</span>
-
- <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">json</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">output</span> <span class="o">=</span> <span class="nx">meta</span> <span class="o">||</span> <span class="p">{};</span>
- <span class="nx">output</span><span class="p">.</span><span class="nx">level</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">level</span><span class="p">;</span>
- <span class="nx">output</span><span class="p">.</span><span class="nx">message</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">message</span><span class="p">;</span>
-
- <span class="k">if</span> <span class="p">(</span><span class="nx">timestamp</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">output</span><span class="p">.</span><span class="nx">timestamp</span> <span class="o">=</span> <span class="nx">timestamp</span><span class="p">;</span>
- <span class="p">}</span>
-
- <span class="k">return</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">output</span><span class="p">);</span>
- <span class="p">}</span>
-
- <span class="nx">output</span> <span class="o">=</span> <span class="nx">timestamp</span> <span class="o">?</span> <span class="nx">timestamp</span> <span class="o">+</span> <span class="s1">&#39; - &#39;</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
- <span class="nx">output</span> <span class="o">+=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">colorize</span> <span class="o">?</span> <span class="nx">config</span><span class="p">.</span><span class="nx">colorize</span><span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">level</span><span class="p">)</span> <span class="o">:</span> <span class="nx">options</span><span class="p">.</span><span class="nx">level</span><span class="p">;</span>
- <span class="nx">output</span> <span class="o">+=</span> <span class="p">(</span><span class="s1">&#39;: &#39;</span> <span class="o">+</span> <span class="nx">options</span><span class="p">.</span><span class="nx">message</span><span class="p">);</span>
-
- <span class="k">if</span> <span class="p">(</span><span class="nx">meta</span> <span class="o">&amp;&amp;</span> <span class="k">typeof</span> <span class="nx">meta</span> <span class="o">===</span> <span class="s1">&#39;object&#39;</span> <span class="o">&amp;&amp;</span> <span class="nb">Object</span><span class="p">.</span><span class="nx">keys</span><span class="p">(</span><span class="nx">meta</span><span class="p">).</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">output</span> <span class="o">+=</span> <span class="s1">&#39; &#39;</span> <span class="o">+</span> <span class="nx">loggly</span><span class="p">.</span><span class="nx">serialize</span><span class="p">(</span><span class="nx">meta</span><span class="p">);</span>
- <span class="p">}</span>
-
- <span class="k">return</span> <span class="nx">output</span><span class="p">;</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <h3>function hash (str)</h3>
-
-<h4>@str {string} String to hash.</h4>
-
-<p>Utility function for creating unique ids
-e.g. Profiling incoming HTTP requests on the same tick</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">hash</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">str</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="nx">crypto</span><span class="p">.</span><span class="nx">createHash</span><span class="p">(</span><span class="s1">&#39;sha1&#39;</span><span class="p">).</span><span class="nx">update</span><span class="p">(</span><span class="nx">str</span><span class="p">).</span><span class="nx">digest</span><span class="p">(</span><span class="s1">&#39;hex&#39;</span><span class="p">);</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <h2>Borrowed from node.js core</h2>
-
-<p>I wanted a universal lowercase header message, as opposed to the <code>DEBUG</code>
-(i.e. all uppercase header) used only in <code>util.debug()</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">months</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;Jan&#39;</span><span class="p">,</span> <span class="s1">&#39;Feb&#39;</span><span class="p">,</span> <span class="s1">&#39;Mar&#39;</span><span class="p">,</span> <span class="s1">&#39;Apr&#39;</span><span class="p">,</span>
- <span class="s1">&#39;May&#39;</span><span class="p">,</span> <span class="s1">&#39;Jun&#39;</span><span class="p">,</span> <span class="s1">&#39;Jul&#39;</span><span class="p">,</span> <span class="s1">&#39;Aug&#39;</span><span class="p">,</span>
- <span class="s1">&#39;Sep&#39;</span><span class="p">,</span> <span class="s1">&#39;Oct&#39;</span><span class="p">,</span> <span class="s1">&#39;Nov&#39;</span><span class="p">,</span> <span class="s1">&#39;Dec&#39;</span><span class="p">];</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <h3>function pad (n)</h3>
-
-<p>Returns a padded string if <code>n &lt; 10</code>.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">pad</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">n</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="nx">n</span> <span class="o">&lt;</span> <span class="mi">10</span> <span class="o">?</span> <span class="s1">&#39;0&#39;</span> <span class="o">+</span> <span class="nx">n</span><span class="p">.</span><span class="nx">toString</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span> <span class="o">:</span> <span class="nx">n</span><span class="p">.</span><span class="nx">toString</span><span class="p">(</span><span class="mi">10</span><span class="p">);</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <h3>function timestamp ()</h3>
-
-<p>Returns a timestamp string for the current time.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">timestamp</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
- <span class="kd">var</span> <span class="nx">d</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="p">();</span>
- <span class="kd">var</span> <span class="nx">time</span> <span class="o">=</span> <span class="p">[</span>
- <span class="nx">exports</span><span class="p">.</span><span class="nx">pad</span><span class="p">(</span><span class="nx">d</span><span class="p">.</span><span class="nx">getHours</span><span class="p">()),</span>
- <span class="nx">exports</span><span class="p">.</span><span class="nx">pad</span><span class="p">(</span><span class="nx">d</span><span class="p">.</span><span class="nx">getMinutes</span><span class="p">()),</span>
- <span class="nx">exports</span><span class="p">.</span><span class="nx">pad</span><span class="p">(</span><span class="nx">d</span><span class="p">.</span><span class="nx">getSeconds</span><span class="p">())</span>
- <span class="p">].</span><span class="nx">join</span><span class="p">(</span><span class="s1">&#39;:&#39;</span><span class="p">);</span>
-
- <span class="k">return</span> <span class="p">[</span><span class="nx">d</span><span class="p">.</span><span class="nx">getDate</span><span class="p">(),</span> <span class="nx">months</span><span class="p">[</span><span class="nx">d</span><span class="p">.</span><span class="nx">getMonth</span><span class="p">()],</span> <span class="nx">time</span><span class="p">].</span><span class="nx">join</span><span class="p">(</span><span class="s1">&#39; &#39;</span><span class="p">);</span>
-<span class="p">};</span>
-
-</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
37 docs/winston/config.html
@@ -1,37 +0,0 @@
-<!DOCTYPE html> <html> <head> <title>config.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="../docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="..//winston/common.html"> winston/common.html </a> <a class="source" href="..//winston/config/cli-config.html"> winston/config/cli-config.html </a> <a class="source" href="..//winston/config/npm-config.html"> winston/config/npm-config.html </a> <a class="source" href="..//winston/config/syslog-config.html"> winston/config/syslog-config.html </a> <a class="source" href="..//winston/config.html"> winston/config.html </a> <a class="source" href="..//winston/exception.html"> winston/exception.html </a> <a class="source" href="..//winston/logger.html"> winston/logger.html </a> <a class="source" href="..//winston/transports/console.html"> winston/transports/console.html </a> <a class="source" href="..//winston/transports/couchdb.html"> winston/transports/couchdb.html </a> <a class="source" href="..//winston/transports/file.html"> winston/transports/file.html </a> <a class="source" href="..//winston/transports/loggly.html"> winston/transports/loggly.html </a> <a class="source" href="..//winston/transports/transport.html"> winston/transports/transport.html </a> <a class="source" href="..//winston/transports/webhook.html"> winston/transports/webhook.html </a> <a class="source" href="..//winston/transports.html"> winston/transports.html </a> <a class="source" href="..//winston.html"> winston.html </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> config.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="cm">/*</span>
-<span class="cm"> * config.js: Default settings for all levels that winston knows about </span>
-<span class="cm"> *</span>
-<span class="cm"> * (C) 2010 Charlie Robbins</span>
-<span class="cm"> * MIT LICENCE</span>
-<span class="cm"> *</span>
-<span class="cm"> */</span>
-
-<span class="kd">var</span> <span class="nx">colors</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;colors&#39;</span><span class="p">);</span>
-
-<span class="kd">var</span> <span class="nx">config</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">,</span>
- <span class="nx">allColors</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">allColors</span> <span class="o">=</span> <span class="p">{};</span>
-
-<span class="nx">config</span><span class="p">.</span><span class="nx">addColors</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">colors</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">mixin</span><span class="p">(</span><span class="nx">allColors</span><span class="p">,</span> <span class="nx">colors</span><span class="p">);</span>
-<span class="p">};</span>
-
-<span class="nx">config</span><span class="p">.</span><span class="nx">colorize</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">level</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="nx">level</span><span class="p">[</span><span class="nx">allColors</span><span class="p">[</span><span class="nx">level</span><span class="p">]];</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Export config sets</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">config</span><span class="p">.</span><span class="nx">cli</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./config/cli-config&#39;</span><span class="p">);</span>
-<span class="nx">config</span><span class="p">.</span><span class="nx">npm</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./config/npm-config&#39;</span><span class="p">);</span>
-<span class="nx">config</span><span class="p">.</span><span class="nx">syslog</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./config/syslog-config&#39;</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Add colors for pre-defined config sets</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">config</span><span class="p">.</span><span class="nx">addColors</span><span class="p">(</span><span class="nx">config</span><span class="p">.</span><span class="nx">npm</span><span class="p">.</span><span class="nx">colors</span><span class="p">);</span>
-<span class="nx">config</span><span class="p">.</span><span class="nx">addColors</span><span class="p">(</span><span class="nx">config</span><span class="p">.</span><span class="nx">syslog</span><span class="p">.</span><span class="nx">colors</span><span class="p">);</span>
-
-<span class="kd">function</span> <span class="nx">mixin</span> <span class="p">(</span><span class="nx">target</span><span class="p">)</span> <span class="p">{</span>
- <span class="kd">var</span> <span class="nx">args</span> <span class="o">=</span> <span class="nb">Array</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">slice</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">arguments</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>
-
- <span class="nx">args</span><span class="p">.</span><span class="nx">forEach</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">a</span><span class="p">)</span> <span class="p">{</span>
- <span class="kd">var</span> <span class="nx">keys</span> <span class="o">=</span> <span class="nb">Object</span><span class="p">.</span><span class="nx">keys</span><span class="p">(</span><span class="nx">a</span><span class="p">);</span>
- <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">keys</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">target</span><span class="p">[</span><span class="nx">keys</span><span class="p">[</span><span class="nx">i</span><span class="p">]]</span> <span class="o">=</span> <span class="nx">a</span><span class="p">[</span><span class="nx">keys</span><span class="p">[</span><span class="nx">i</span><span class="p">]];</span>
- <span class="p">}</span>
- <span class="p">});</span>
- <span class="k">return</span> <span class="nx">target</span><span class="p">;</span>
-<span class="p">};</span>
-
-</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
37 docs/winston/config/cli-config.html
@@ -1,37 +0,0 @@
-<!DOCTYPE html> <html> <head> <title>cli-config.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="../../docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="../..//winston/common.html"> winston/common.html </a> <a class="source" href="../..//winston/config/cli-config.html"> winston/config/cli-config.html </a> <a class="source" href="../..//winston/config/npm-config.html"> winston/config/npm-config.html </a> <a class="source" href="../..//winston/config/syslog-config.html"> winston/config/syslog-config.html </a> <a class="source" href="../..//winston/config.html"> winston/config.html </a> <a class="source" href="../..//winston/exception.html"> winston/exception.html </a> <a class="source" href="../..//winston/logger.html"> winston/logger.html </a> <a class="source" href="../..//winston/transports/console.html"> winston/transports/console.html </a> <a class="source" href="../..//winston/transports/couchdb.html"> winston/transports/couchdb.html </a> <a class="source" href="../..//winston/transports/file.html"> winston/transports/file.html </a> <a class="source" href="../..//winston/transports/loggly.html"> winston/transports/loggly.html </a> <a class="source" href="../..//winston/transports/transport.html"> winston/transports/transport.html </a> <a class="source" href="../..//winston/transports/webhook.html"> winston/transports/webhook.html </a> <a class="source" href="../..//winston/transports.html"> winston/transports.html </a> <a class="source" href="../..//winston.html"> winston.html </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> cli-config.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="cm">/*</span>
-<span class="cm"> * cli-config.js: Config that conform to commonly used CLI logging levels. </span>
-<span class="cm"> *</span>
-<span class="cm"> * (C) 2010 Charlie Robbins</span>
-<span class="cm"> * MIT LICENCE</span>
-<span class="cm"> *</span>
-<span class="cm"> */</span>
-
-<span class="kd">var</span> <span class="nx">cliConfig</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">;</span>
-
-<span class="nx">cliConfig</span><span class="p">.</span><span class="nx">levels</span> <span class="o">=</span> <span class="p">{</span>
- <span class="nx">silly</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
- <span class="nx">input</span><span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
- <span class="nx">verbose</span><span class="o">:</span> <span class="mi">2</span><span class="p">,</span>
- <span class="nx">prompt</span><span class="o">:</span> <span class="mi">3</span><span class="p">,</span>
- <span class="nx">info</span><span class="o">:</span> <span class="mi">4</span><span class="p">,</span>
- <span class="nx">data</span><span class="o">:</span> <span class="mi">5</span><span class="p">,</span>
- <span class="nx">help</span><span class="o">:</span> <span class="mi">6</span><span class="p">,</span>
- <span class="nx">warn</span><span class="o">:</span> <span class="mi">7</span><span class="p">,</span>
- <span class="nx">debug</span><span class="o">:</span> <span class="mi">8</span><span class="p">,</span>
- <span class="nx">error</span><span class="o">:</span> <span class="mi">9</span>
-<span class="p">};</span>
-
-<span class="nx">cliConfig</span><span class="p">.</span><span class="nx">colors</span> <span class="o">=</span> <span class="p">{</span>
- <span class="nx">silly</span><span class="o">:</span> <span class="s1">&#39;magenta&#39;</span><span class="p">,</span>
- <span class="nx">input</span><span class="o">:</span> <span class="s1">&#39;grey&#39;</span><span class="p">,</span>
- <span class="nx">verbose</span><span class="o">:</span> <span class="s1">&#39;cyan&#39;</span><span class="p">,</span>
- <span class="nx">prompt</span><span class="o">:</span> <span class="s1">&#39;grey&#39;</span><span class="p">,</span>
- <span class="nx">info</span><span class="o">:</span> <span class="s1">&#39;green&#39;</span><span class="p">,</span>
- <span class="nx">data</span><span class="o">:</span> <span class="s1">&#39;grey&#39;</span><span class="p">,</span>
- <span class="nx">help</span><span class="o">:</span> <span class="s1">&#39;cyan&#39;</span><span class="p">,</span>
- <span class="nx">warn</span><span class="o">:</span> <span class="s1">&#39;yellow&#39;</span><span class="p">,</span>
- <span class="nx">debug</span><span class="o">:</span> <span class="s1">&#39;blue&#39;</span><span class="p">,</span>
- <span class="nx">error</span><span class="o">:</span> <span class="s1">&#39;red&#39;</span>
-<span class="p">};</span>
-
-</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
29 docs/winston/config/npm-config.html
@@ -1,29 +0,0 @@
-<!DOCTYPE html> <html> <head> <title>npm-config.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="../../docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="../..//winston/common.html"> winston/common.html </a> <a class="source" href="../..//winston/config/cli-config.html"> winston/config/cli-config.html </a> <a class="source" href="../..//winston/config/npm-config.html"> winston/config/npm-config.html </a> <a class="source" href="../..//winston/config/syslog-config.html"> winston/config/syslog-config.html </a> <a class="source" href="../..//winston/config.html"> winston/config.html </a> <a class="source" href="../..//winston/exception.html"> winston/exception.html </a> <a class="source" href="../..//winston/logger.html"> winston/logger.html </a> <a class="source" href="../..//winston/transports/console.html"> winston/transports/console.html </a> <a class="source" href="../..//winston/transports/couchdb.html"> winston/transports/couchdb.html </a> <a class="source" href="../..//winston/transports/file.html"> winston/transports/file.html </a> <a class="source" href="../..//winston/transports/loggly.html"> winston/transports/loggly.html </a> <a class="source" href="../..//winston/transports/transport.html"> winston/transports/transport.html </a> <a class="source" href="../..//winston/transports/webhook.html"> winston/transports/webhook.html </a> <a class="source" href="../..//winston/transports.html"> winston/transports.html </a> <a class="source" href="../..//winston.html"> winston.html </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> npm-config.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="cm">/*</span>
-<span class="cm"> * npm-config.js: Config that conform to npm logging levels. </span>
-<span class="cm"> *</span>
-<span class="cm"> * (C) 2010 Charlie Robbins</span>
-<span class="cm"> * MIT LICENCE</span>
-<span class="cm"> *</span>
-<span class="cm"> */</span>
-
-<span class="kd">var</span> <span class="nx">npmConfig</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">;</span>
-
-<span class="nx">npmConfig</span><span class="p">.</span><span class="nx">levels</span> <span class="o">=</span> <span class="p">{</span>
- <span class="nx">silly</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
- <span class="nx">verbose</span><span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
- <span class="nx">info</span><span class="o">:</span> <span class="mi">2</span><span class="p">,</span>
- <span class="nx">warn</span><span class="o">:</span> <span class="mi">3</span><span class="p">,</span>
- <span class="nx">debug</span><span class="o">:</span> <span class="mi">4</span><span class="p">,</span>
- <span class="nx">error</span><span class="o">:</span> <span class="mi">5</span>
-<span class="p">};</span>
-
-<span class="nx">npmConfig</span><span class="p">.</span><span class="nx">colors</span> <span class="o">=</span> <span class="p">{</span>
- <span class="nx">silly</span><span class="o">:</span> <span class="s1">&#39;magenta&#39;</span><span class="p">,</span>
- <span class="nx">verbose</span><span class="o">:</span> <span class="s1">&#39;cyan&#39;</span><span class="p">,</span>
- <span class="nx">info</span><span class="o">:</span> <span class="s1">&#39;green&#39;</span><span class="p">,</span>
- <span class="nx">warn</span><span class="o">:</span> <span class="s1">&#39;yellow&#39;</span><span class="p">,</span>
- <span class="nx">debug</span><span class="o">:</span> <span class="s1">&#39;blue&#39;</span><span class="p">,</span>
- <span class="nx">error</span><span class="o">:</span> <span class="s1">&#39;red&#39;</span>
-<span class="p">};</span>
-
-</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
33 docs/winston/config/syslog-config.html
@@ -1,33 +0,0 @@
-<!DOCTYPE html> <html> <head> <title>syslog-config.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="../../docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="../..//winston/common.html"> winston/common.html </a> <a class="source" href="../..//winston/config/cli-config.html"> winston/config/cli-config.html </a> <a class="source" href="../..//winston/config/npm-config.html"> winston/config/npm-config.html </a> <a class="source" href="../..//winston/config/syslog-config.html"> winston/config/syslog-config.html </a> <a class="source" href="../..//winston/config.html"> winston/config.html </a> <a class="source" href="../..//winston/exception.html"> winston/exception.html </a> <a class="source" href="../..//winston/logger.html"> winston/logger.html </a> <a class="source" href="../..//winston/transports/console.html"> winston/transports/console.html </a> <a class="source" href="../..//winston/transports/couchdb.html"> winston/transports/couchdb.html </a> <a class="source" href="../..//winston/transports/file.html"> winston/transports/file.html </a> <a class="source" href="../..//winston/transports/loggly.html"> winston/transports/loggly.html </a> <a class="source" href="../..//winston/transports/transport.html"> winston/transports/transport.html </a> <a class="source" href="../..//winston/transports/webhook.html"> winston/transports/webhook.html </a> <a class="source" href="../..//winston/transports.html"> winston/transports.html </a> <a class="source" href="../..//winston.html"> winston.html </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> syslog-config.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="cm">/*</span>
-<span class="cm"> * syslog-config.js: Config that conform to syslog logging levels. </span>
-<span class="cm"> *</span>
-<span class="cm"> * (C) 2010 Charlie Robbins</span>
-<span class="cm"> * MIT LICENCE</span>
-<span class="cm"> *</span>
-<span class="cm"> */</span>
-
-<span class="kd">var</span> <span class="nx">syslogConfig</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">;</span>
-
-<span class="nx">syslogConfig</span><span class="p">.</span><span class="nx">levels</span> <span class="o">=</span> <span class="p">{</span>
- <span class="nx">debug</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
- <span class="nx">info</span><span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
- <span class="nx">notice</span><span class="o">:</span> <span class="mi">2</span><span class="p">,</span>
- <span class="nx">warning</span><span class="o">:</span> <span class="mi">3</span><span class="p">,</span>
- <span class="nx">error</span><span class="o">:</span> <span class="mi">4</span><span class="p">,</span>
- <span class="nx">crit</span><span class="o">:</span> <span class="mi">5</span><span class="p">,</span>
- <span class="nx">alert</span><span class="o">:</span> <span class="mi">6</span><span class="p">,</span>
- <span class="nx">emerg</span><span class="o">:</span> <span class="mi">7</span>
-<span class="p">};</span>
-
-<span class="nx">syslogConfig</span><span class="p">.</span><span class="nx">colors</span> <span class="o">=</span> <span class="p">{</span>
- <span class="nx">debug</span><span class="o">:</span> <span class="s1">&#39;blue&#39;</span><span class="p">,</span>
- <span class="nx">info</span><span class="o">:</span> <span class="s1">&#39;green&#39;</span><span class="p">,</span>
- <span class="nx">notice</span><span class="o">:</span> <span class="s1">&#39;yellow&#39;</span><span class="p">,</span>
- <span class="nx">warning</span><span class="o">:</span> <span class="s1">&#39;red&#39;</span><span class="p">,</span>
- <span class="nx">error</span><span class="o">:</span> <span class="s1">&#39;red&#39;</span><span class="p">,</span>
- <span class="nx">crit</span><span class="o">:</span> <span class="s1">&#39;red&#39;</span><span class="p">,</span>
- <span class="nx">alert</span><span class="o">:</span> <span class="s1">&#39;yellow&#39;</span><span class="p">,</span>
- <span class="nx">emerg</span><span class="o">:</span> <span class="s1">&#39;red&#39;</span>
-<span class="p">};</span>
-
-</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
56 docs/winston/exception.html
@@ -1,56 +0,0 @@
-<!DOCTYPE html> <html> <head> <title>exception.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="../docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="..//winston/common.html"> winston/common.html </a> <a class="source" href="..//winston/config/cli-config.html"> winston/config/cli-config.html </a> <a class="source" href="..//winston/config/npm-config.html"> winston/config/npm-config.html </a> <a class="source" href="..//winston/config/syslog-config.html"> winston/config/syslog-config.html </a> <a class="source" href="..//winston/config.html"> winston/config.html </a> <a class="source" href="..//winston/exception.html"> winston/exception.html </a> <a class="source" href="..//winston/logger.html"> winston/logger.html </a> <a class="source" href="..//winston/transports/console.html"> winston/transports/console.html </a> <a class="source" href="..//winston/transports/couchdb.html"> winston/transports/couchdb.html </a> <a class="source" href="..//winston/transports/file.html"> winston/transports/file.html </a> <a class="source" href="..//winston/transports/loggly.html"> winston/transports/loggly.html </a> <a class="source" href="..//winston/transports/transport.html"> winston/transports/transport.html </a> <a class="source" href="..//winston/transports/webhook.html"> winston/transports/webhook.html </a> <a class="source" href="..//winston/transports.html"> winston/transports.html </a> <a class="source" href="..//winston.html"> winston.html </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> exception.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="cm">/*</span>
-<span class="cm"> * exception.js: Utility methods for gathing information about uncaughtExceptions.</span>
-<span class="cm"> *</span>
-<span class="cm"> * (C) 2010 Charlie Robbins</span>
-<span class="cm"> * MIT LICENCE</span>
-<span class="cm"> *</span>
-<span class="cm"> */</span>
-
-<span class="kd">var</span> <span class="nx">os</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;os&#39;</span><span class="p">),</span>
- <span class="nx">stackTrace</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;stack-trace&#39;</span><span class="p">);</span>
-
-<span class="kd">var</span> <span class="nx">exception</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">;</span>
-
-<span class="nx">exception</span><span class="p">.</span><span class="nx">getAllInfo</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="p">{</span>
- <span class="nx">process</span><span class="o">:</span> <span class="nx">exception</span><span class="p">.</span><span class="nx">getProcessInfo</span><span class="p">(),</span>
- <span class="nx">os</span><span class="o">:</span> <span class="nx">exception</span><span class="p">.</span><span class="nx">getOsInfo</span><span class="p">(),</span>
- <span class="nx">trace</span><span class="o">:</span> <span class="nx">exception</span><span class="p">.</span><span class="nx">getTrace</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
- <span class="p">};</span>
-<span class="p">};</span>
-
-<span class="nx">exception</span><span class="p">.</span><span class="nx">getProcessInfo</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
- <span class="k">return</span> <span class="p">{</span>
- <span class="nx">pid</span><span class="o">:</span> <span class="nx">process</span><span class="p">.</span><span class="nx">pid</span><span class="p">,</span>
- <span class="nx">uid</span><span class="o">:</span> <span class="nx">process</span><span class="p">.</span><span class="nx">getuid</span><span class="p">(),</span>
- <span class="nx">gid</span><span class="o">:</span> <span class="nx">process</span><span class="p">.</span><span class="nx">getgid</span><span class="p">(),</span>
- <span class="nx">cwd</span><span class="o">:</span> <span class="nx">process</span><span class="p">.</span><span class="nx">cwd</span><span class="p">(),</span>
- <span class="nx">execPath</span><span class="o">:</span> <span class="nx">process</span><span class="p">.</span><span class="nx">execPath</span><span class="p">,</span>
- <span class="nx">version</span><span class="o">:</span> <span class="nx">process</span><span class="p">.</span><span class="nx">version</span><span class="p">,</span>
- <span class="nx">argv</span><span class="o">:</span> <span class="nx">process</span><span class="p">.</span><span class="nx">argv</span><span class="p">,</span>
- <span class="nx">memoryUsage</span><span class="o">:</span> <span class="nx">process</span><span class="p">.</span><span class="nx">memoryUsage</span><span class="p">()</span>
- <span class="p">};</span>
-<span class="p">};</span>
-
-<span class="nx">exception</span><span class="p">.</span><span class="nx">getOsInfo</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
- <span class="k">return</span> <span class="p">{</span>
- <span class="nx">loadavg</span><span class="o">:</span> <span class="nx">os</span><span class="p">.</span><span class="nx">loadavg</span><span class="p">(),</span>
- <span class="nx">uptime</span><span class="o">:</span> <span class="nx">os</span><span class="p">.</span><span class="nx">uptime</span><span class="p">()</span>
- <span class="p">};</span>
-<span class="p">};</span>
-
-<span class="nx">exception</span><span class="p">.</span><span class="nx">getTrace</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span>
- <span class="kd">var</span> <span class="nx">trace</span> <span class="o">=</span> <span class="nx">err</span> <span class="o">?</span> <span class="nx">stackTrace</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="o">:</span> <span class="nx">stackTrace</span><span class="p">.</span><span class="nx">get</span><span class="p">();</span>
- <span class="k">return</span> <span class="nx">trace</span><span class="p">.</span><span class="nx">map</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">site</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="p">{</span>
- <span class="nx">column</span><span class="o">:</span> <span class="nx">site</span><span class="p">.</span><span class="nx">getColumnNumber</span><span class="p">(),</span>
- <span class="nx">file</span><span class="o">:</span> <span class="nx">site</span><span class="p">.</span><span class="nx">getFileName</span><span class="p">(),</span>
- <span class="kd">function</span><span class="o">:</span> <span class="nx">site</span><span class="p">.</span><span class="nx">getFunctionName</span><span class="p">(),</span>
- <span class="nx">line</span><span class="o">:</span> <span class="nx">site</span><span class="p">.</span><span class="nx">getLineNumber</span><span class="p">(),</span>
- <span class="nx">method</span><span class="o">:</span> <span class="nx">site</span><span class="p">.</span><span class="nx">getMethodName</span><span class="p">(),</span>
- <span class="kr">native</span><span class="o">:</span> <span class="nx">site</span><span class="p">.</span><span class="nx">isNative</span><span class="p">(),</span>
- <span class="p">}</span>
- <span class="p">});</span>
-<span class="p">};</span>
-
-</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
344 docs/winston/logger.html
@@ -1,344 +0,0 @@
-<!DOCTYPE html> <html> <head> <title>logger.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="../docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="..//winston/common.html"> winston/common.html </a> <a class="source" href="..//winston/config/cli-config.html"> winston/config/cli-config.html </a> <a class="source" href="..//winston/config/npm-config.html"> winston/config/npm-config.html </a> <a class="source" href="..//winston/config/syslog-config.html"> winston/config/syslog-config.html </a> <a class="source" href="..//winston/config.html"> winston/config.html </a> <a class="source" href="..//winston/exception.html"> winston/exception.html </a> <a class="source" href="..//winston/logger.html"> winston/logger.html </a> <a class="source" href="..//winston/transports/console.html"> winston/transports/console.html </a> <a class="source" href="..//winston/transports/couchdb.html"> winston/transports/couchdb.html </a> <a class="source" href="..//winston/transports/file.html"> winston/transports/file.html </a> <a class="source" href="..//winston/transports/loggly.html"> winston/transports/loggly.html </a> <a class="source" href="..//winston/transports/transport.html"> winston/transports/transport.html </a> <a class="source" href="..//winston/transports/webhook.html"> winston/transports/webhook.html </a> <a class="source" href="..//winston/transports.html"> winston/transports.html </a> <a class="source" href="..//winston.html"> winston.html </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> logger.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="cm">/*</span>
-<span class="cm"> * logger.js: Core logger object used by winston.</span>
-<span class="cm"> *</span>
-<span class="cm"> * (C) 2010 Charlie Robbins</span>
-<span class="cm"> * MIT LICENCE</span>
-<span class="cm"> *</span>
-<span class="cm"> */</span>
-
-<span class="kd">var</span> <span class="nx">events</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;events&#39;</span><span class="p">),</span>
- <span class="nx">util</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;util&#39;</span><span class="p">),</span>
- <span class="nx">async</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;async&#39;</span><span class="p">),</span>
- <span class="nx">config</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./config&#39;</span><span class="p">),</span>
- <span class="nx">common</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./common&#39;</span><span class="p">),</span>
- <span class="nx">exception</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./exception&#39;</span><span class="p">);</span>
-
-<span class="kd">function</span> <span class="nx">capitalize</span><span class="p">(</span><span class="nx">str</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="nx">str</span> <span class="o">&amp;&amp;</span> <span class="nx">str</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">toUpperCase</span><span class="p">()</span> <span class="o">+</span> <span class="nx">str</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
-<span class="p">}</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Time constants</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">ticksPerMillisecond</span> <span class="o">=</span> <span class="mi">10000</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <h3>function Logger (options)</h3>
-
-<h4>@options {Object} Options for this instance.</h4>
-
-<p>Constructor function for the Logger object responsible
-for persisting log messages and metadata to one or more transports.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">Logger</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">Logger</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">options</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">events</span><span class="p">.</span><span class="nx">EventEmitter</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
- <span class="nx">options</span> <span class="o">=</span> <span class="nx">options</span> <span class="o">||</span> <span class="p">{};</span>
-
- <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span>
- <span class="nx">handleExceptions</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
- </pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Set Levels and default logging level</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">this</span><span class="p">.</span><span class="nx">padLevels</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">padLevels</span> <span class="o">||</span> <span class="kc">false</span><span class="p">;</span>
- <span class="k">this</span><span class="p">.</span><span class="nx">setLevels</span><span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">levels</span><span class="p">);</span>
- </pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Setup other intelligent default settings.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">this</span><span class="p">.</span><span class="nx">level</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">level</span> <span class="o">||</span> <span class="s1">&#39;info&#39;</span><span class="p">;</span>
- <span class="k">this</span><span class="p">.</span><span class="nx">emitErrs</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">emitErrs</span> <span class="o">||</span> <span class="kc">false</span><span class="p">;</span>
- <span class="k">this</span><span class="p">.</span><span class="nx">stripColors</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">stripColors</span> <span class="o">||</span> <span class="kc">false</span><span class="p">;</span>
- <span class="k">this</span><span class="p">.</span><span class="nx">transports</span> <span class="o">=</span> <span class="p">{};</span>
- <span class="k">this</span><span class="p">.</span><span class="nx">exceptionHandlers</span> <span class="o">=</span> <span class="p">{};</span>
- <span class="k">this</span><span class="p">.</span><span class="nx">profilers</span> <span class="o">=</span> <span class="p">{};</span>
- <span class="k">this</span><span class="p">.</span><span class="nx">_names</span> <span class="o">=</span> <span class="p">[];</span>