added unit testing, and started implementing unit tests...phew
This commit is contained in:
7
node_modules/triple-beam/.eslintrc
generated
vendored
Normal file
7
node_modules/triple-beam/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "populist",
|
||||
"rules": {
|
||||
"one-var": ["error", { var: "never", let: "never", const: "never" }],
|
||||
"strict": 0
|
||||
}
|
||||
}
|
1
node_modules/triple-beam/.gitattributes
generated
vendored
Normal file
1
node_modules/triple-beam/.gitattributes
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
package-lock.json binary
|
17
node_modules/triple-beam/.travis.yml
generated
vendored
Normal file
17
node_modules/triple-beam/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- "6"
|
||||
- "8"
|
||||
- "10"
|
||||
|
||||
before_install:
|
||||
- travis_retry npm install
|
||||
|
||||
script:
|
||||
- npm test
|
||||
|
||||
notifications:
|
||||
email:
|
||||
- travis@nodejitsu.com
|
||||
irc: "irc.freenode.org#nodejitsu"
|
22
node_modules/triple-beam/CHANGELOG.md
generated
vendored
Normal file
22
node_modules/triple-beam/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
# CHANGELOG
|
||||
|
||||
### 1.3.0
|
||||
|
||||
- [#4] Add `SPLAT` symbol.
|
||||
- [#3] Add linting & TravisCI.
|
||||
|
||||
### 1.2.0
|
||||
|
||||
- [#2] Move configs from `winston.config.{npm,syslog,npm}` into `triple-beam`.
|
||||
|
||||
### 1.1.0
|
||||
|
||||
- Expose a `MESSAGE` Symbol, nothing more.
|
||||
|
||||
### 1.0.1
|
||||
|
||||
- Use `Symbol.for` because that is how they work apparently.
|
||||
|
||||
### 1.0.0
|
||||
|
||||
- Initial version. Defines a `LEVEL` Symbol, nothing more.
|
21
node_modules/triple-beam/LICENSE
generated
vendored
Normal file
21
node_modules/triple-beam/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 winstonjs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
34
node_modules/triple-beam/README.md
generated
vendored
Normal file
34
node_modules/triple-beam/README.md
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
# triple-beam
|
||||
|
||||
Definitions of levels for logging purposes & shareable Symbol constants.
|
||||
|
||||
## Usage
|
||||
|
||||
``` js
|
||||
const { LEVEL } = require('triple-beam');
|
||||
const colors = require('colors/safe');
|
||||
|
||||
const info = {
|
||||
[LEVEL]: 'error',
|
||||
level: 'error',
|
||||
message: 'hey a logging message!'
|
||||
};
|
||||
|
||||
// Colorize your log level!
|
||||
info.level = colors.green(info.level);
|
||||
|
||||
// And still have an unmutated copy of your level!
|
||||
console.log(info.level === 'error'); // false
|
||||
console.log(info[LEVEL] === 'error'); // true
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
Tests are written with `mocha`, `assume`, and `nyc`. They can be run with `npm`:
|
||||
|
||||
```
|
||||
npm test
|
||||
```
|
||||
|
||||
##### LICENSE: MIT
|
||||
##### AUTHOR: [Charlie Robbins](https://github.com/indexzero)
|
42
node_modules/triple-beam/config/cli.js
generated
vendored
Normal file
42
node_modules/triple-beam/config/cli.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
/**
|
||||
* cli.js: Config that conform to commonly used CLI logging levels.
|
||||
*
|
||||
* (C) 2010 Charlie Robbins
|
||||
* MIT LICENCE
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Default levels for the CLI configuration.
|
||||
* @type {Object}
|
||||
*/
|
||||
exports.levels = {
|
||||
error: 0,
|
||||
warn: 1,
|
||||
help: 2,
|
||||
data: 3,
|
||||
info: 4,
|
||||
debug: 5,
|
||||
prompt: 6,
|
||||
verbose: 7,
|
||||
input: 8,
|
||||
silly: 9
|
||||
};
|
||||
|
||||
/**
|
||||
* Default colors for the CLI configuration.
|
||||
* @type {Object}
|
||||
*/
|
||||
exports.colors = {
|
||||
error: 'red',
|
||||
warn: 'yellow',
|
||||
help: 'cyan',
|
||||
data: 'grey',
|
||||
info: 'green',
|
||||
debug: 'blue',
|
||||
prompt: 'grey',
|
||||
verbose: 'cyan',
|
||||
input: 'grey',
|
||||
silly: 'magenta'
|
||||
};
|
32
node_modules/triple-beam/config/index.js
generated
vendored
Normal file
32
node_modules/triple-beam/config/index.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
* index.js: Default settings for all levels that winston knows about.
|
||||
*
|
||||
* (C) 2010 Charlie Robbins
|
||||
* MIT LICENCE
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Export config set for the CLI.
|
||||
* @type {Object}
|
||||
*/
|
||||
Object.defineProperty(exports, 'cli', {
|
||||
value: require('./cli')
|
||||
});
|
||||
|
||||
/**
|
||||
* Export config set for npm.
|
||||
* @type {Object}
|
||||
*/
|
||||
Object.defineProperty(exports, 'npm', {
|
||||
value: require('./npm')
|
||||
});
|
||||
|
||||
/**
|
||||
* Export config set for the syslog.
|
||||
* @type {Object}
|
||||
*/
|
||||
Object.defineProperty(exports, 'syslog', {
|
||||
value: require('./syslog')
|
||||
});
|
36
node_modules/triple-beam/config/npm.js
generated
vendored
Normal file
36
node_modules/triple-beam/config/npm.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/**
|
||||
* npm.js: Config that conform to npm logging levels.
|
||||
*
|
||||
* (C) 2010 Charlie Robbins
|
||||
* MIT LICENCE
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Default levels for the npm configuration.
|
||||
* @type {Object}
|
||||
*/
|
||||
exports.levels = {
|
||||
error: 0,
|
||||
warn: 1,
|
||||
info: 2,
|
||||
http: 3,
|
||||
verbose: 4,
|
||||
debug: 5,
|
||||
silly: 6
|
||||
};
|
||||
|
||||
/**
|
||||
* Default levels for the npm configuration.
|
||||
* @type {Object}
|
||||
*/
|
||||
exports.colors = {
|
||||
error: 'red',
|
||||
warn: 'yellow',
|
||||
info: 'green',
|
||||
http: 'green',
|
||||
verbose: 'cyan',
|
||||
debug: 'blue',
|
||||
silly: 'magenta'
|
||||
};
|
38
node_modules/triple-beam/config/syslog.js
generated
vendored
Normal file
38
node_modules/triple-beam/config/syslog.js
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
/**
|
||||
* syslog.js: Config that conform to syslog logging levels.
|
||||
*
|
||||
* (C) 2010 Charlie Robbins
|
||||
* MIT LICENCE
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Default levels for the syslog configuration.
|
||||
* @type {Object}
|
||||
*/
|
||||
exports.levels = {
|
||||
emerg: 0,
|
||||
alert: 1,
|
||||
crit: 2,
|
||||
error: 3,
|
||||
warning: 4,
|
||||
notice: 5,
|
||||
info: 6,
|
||||
debug: 7
|
||||
};
|
||||
|
||||
/**
|
||||
* Default levels for the syslog configuration.
|
||||
* @type {Object}
|
||||
*/
|
||||
exports.colors = {
|
||||
emerg: 'red',
|
||||
alert: 'yellow',
|
||||
crit: 'red',
|
||||
error: 'red',
|
||||
warning: 'red',
|
||||
notice: 'yellow',
|
||||
info: 'green',
|
||||
debug: 'blue'
|
||||
};
|
46
node_modules/triple-beam/index.js
generated
vendored
Normal file
46
node_modules/triple-beam/index.js
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* A shareable symbol constant that can be used
|
||||
* as a non-enumerable / semi-hidden level identifier
|
||||
* to allow the readable level property to be mutable for
|
||||
* operations like colorization
|
||||
*
|
||||
* @type {Symbol}
|
||||
*/
|
||||
Object.defineProperty(exports, 'LEVEL', {
|
||||
value: Symbol.for('level')
|
||||
});
|
||||
|
||||
/**
|
||||
* A shareable symbol constant that can be used
|
||||
* as a non-enumerable / semi-hidden message identifier
|
||||
* to allow the final message property to not have
|
||||
* side effects on another.
|
||||
*
|
||||
* @type {Symbol}
|
||||
*/
|
||||
Object.defineProperty(exports, 'MESSAGE', {
|
||||
value: Symbol.for('message')
|
||||
});
|
||||
|
||||
/**
|
||||
* A shareable symbol constant that can be used
|
||||
* as a non-enumerable / semi-hidden message identifier
|
||||
* to allow the extracted splat property be hidden
|
||||
*
|
||||
* @type {Symbol}
|
||||
*/
|
||||
Object.defineProperty(exports, 'SPLAT', {
|
||||
value: Symbol.for('splat')
|
||||
});
|
||||
|
||||
/**
|
||||
* A shareable object constant that can be used
|
||||
* as a standard configuration for winston@3.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
Object.defineProperty(exports, 'configs', {
|
||||
value: require('./config')
|
||||
});
|
66
node_modules/triple-beam/package.json
generated
vendored
Normal file
66
node_modules/triple-beam/package.json
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
{
|
||||
"_from": "triple-beam@^1.3.0",
|
||||
"_id": "triple-beam@1.3.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==",
|
||||
"_location": "/triple-beam",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "triple-beam@^1.3.0",
|
||||
"name": "triple-beam",
|
||||
"escapedName": "triple-beam",
|
||||
"rawSpec": "^1.3.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.3.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/logform",
|
||||
"/winston",
|
||||
"/winston-transport"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz",
|
||||
"_shasum": "a595214c7298db8339eeeee083e4d10bd8cb8dd9",
|
||||
"_spec": "triple-beam@^1.3.0",
|
||||
"_where": "/Users/josh.burman/Projects/braid/node_modules/winston",
|
||||
"author": {
|
||||
"name": "Charlie Robbins",
|
||||
"email": "charlie.robbins@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/winstonjs/triple-beam/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Definitions of levels for logging purposes & shareable Symbol constants.",
|
||||
"devDependencies": {
|
||||
"assume": "^2.0.1",
|
||||
"eslint-config-populist": "^4.1.0",
|
||||
"mocha": "^5.1.1",
|
||||
"nyc": "^11.7.1"
|
||||
},
|
||||
"homepage": "https://github.com/winstonjs/triple-beam#readme",
|
||||
"keywords": [
|
||||
"winstonjs",
|
||||
"winston",
|
||||
"logging",
|
||||
"logform",
|
||||
"symbols",
|
||||
"logs",
|
||||
"levels"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "triple-beam",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/winstonjs/triple-beam.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "populist config/*.js index.js",
|
||||
"pretest": "npm run lint",
|
||||
"test": "nyc mocha test.js"
|
||||
},
|
||||
"version": "1.3.0"
|
||||
}
|
98
node_modules/triple-beam/test.js
generated
vendored
Normal file
98
node_modules/triple-beam/test.js
generated
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
const assume = require('assume');
|
||||
const tripleBeam = require('./');
|
||||
|
||||
describe('triple-beam', function () {
|
||||
describe('LEVEL constant', function () {
|
||||
it('is exposed', function () {
|
||||
assume(tripleBeam.LEVEL);
|
||||
});
|
||||
|
||||
it('is a Symbol', function () {
|
||||
assume(tripleBeam.LEVEL).is.a('symbol');
|
||||
});
|
||||
|
||||
it('is not mutable', function () {
|
||||
//
|
||||
// Assert that the symbol does not change
|
||||
// even though the operation does not throw.
|
||||
//
|
||||
const OVERWRITE = Symbol('overwrite');
|
||||
const LEVEL = tripleBeam.LEVEL;
|
||||
|
||||
assume(LEVEL).not.equals(OVERWRITE);
|
||||
tripleBeam.LEVEL = OVERWRITE;
|
||||
assume(tripleBeam.LEVEL).equals(LEVEL);
|
||||
});
|
||||
});
|
||||
|
||||
describe('MESSAGE constant', function () {
|
||||
it('is exposed', function () {
|
||||
assume(tripleBeam.MESSAGE);
|
||||
});
|
||||
|
||||
it('is a Symbol', function () {
|
||||
assume(tripleBeam.MESSAGE).is.a('symbol');
|
||||
});
|
||||
|
||||
it('is not mutable', function () {
|
||||
//
|
||||
// Assert that the symbol does not change
|
||||
// even though the operation does not throw.
|
||||
//
|
||||
const OVERWRITE = Symbol('overwrite');
|
||||
const MESSAGE = tripleBeam.MESSAGE;
|
||||
|
||||
assume(MESSAGE).not.equals(OVERWRITE);
|
||||
tripleBeam.MESSAGE = OVERWRITE;
|
||||
assume(tripleBeam.MESSAGE).equals(MESSAGE);
|
||||
});
|
||||
});
|
||||
|
||||
describe('SPLAT constant', function () {
|
||||
it('is exposed', function () {
|
||||
assume(tripleBeam.SPLAT);
|
||||
});
|
||||
|
||||
it('is a Symbol', function () {
|
||||
assume(tripleBeam.SPLAT).is.a('symbol');
|
||||
});
|
||||
|
||||
it('is not mutable', function () {
|
||||
//
|
||||
// Assert that the symbol does not change
|
||||
// even though the operation does not throw.
|
||||
//
|
||||
const OVERWRITE = Symbol('overwrite');
|
||||
const SPLAT = tripleBeam.SPLAT;
|
||||
|
||||
assume(SPLAT).not.equals(OVERWRITE);
|
||||
tripleBeam.SPLAT = OVERWRITE;
|
||||
assume(tripleBeam.SPLAT).equals(SPLAT);
|
||||
});
|
||||
});
|
||||
|
||||
describe('configs constant', function () {
|
||||
it('is exposed', function () {
|
||||
assume(tripleBeam.configs);
|
||||
});
|
||||
|
||||
it('is a Symbol', function () {
|
||||
assume(tripleBeam.configs).is.an('Object');
|
||||
});
|
||||
|
||||
it('is not mutable', function () {
|
||||
//
|
||||
// Assert that the object does not change
|
||||
// even though the operation does not throw.
|
||||
//
|
||||
const overwrite = {
|
||||
overwrite: 'overwrite'
|
||||
};
|
||||
const configs = tripleBeam.configs;
|
||||
|
||||
assume(configs).not.equals(overwrite);
|
||||
tripleBeam.configs = overwrite;
|
||||
assume(tripleBeam.configs).equals(configs);
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user