-
Notifications
You must be signed in to change notification settings - Fork 0
/
wide.js
47 lines (41 loc) · 1.18 KB
/
wide.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
var Logger = require('./lib/logger').Logger;
var wide = exports = module.exports = new Logger({
transports: [{type: 'console'}]
});
//
// Expose version using `pkginfo`
//
require('pkginfo')(module, 'version');
//
// Expose utility methods
//
var common = require('./lib/common');
wide.hash = common.hash;
wide.clone = common.clone;
wide.mixin = common.mixin;
wide.longestElement = common.longestElement;
wide.exception = require('./lib/exception');
wide.config = require('./lib/config');
wide.addColors = wide.config.addColors;
//
// Expose core Logging-related prototypes.
//
wide.Logger = Logger;
wide.Container = require('./lib/container').Container;
wide.Transport = require('./lib/transports/transport').Transport;
//
// We create and expose a default `Container` to `wide.loggers` so that the
// programmer may manage multiple `wide.Logger` instances without any additional overhead.
//
// ### some-file1.js
//
// var logger = require('wide').loggers.get('something');
//
// ### some-file2.js
//
// var logger = require('wide').loggers.get('something');
//
wide.loggers = new wide.Container();
wide.createLogger = function createLogger(options) {
return new Logger(options);
};