Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "bellman", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "pretty console logger", | ||
@@ -32,3 +32,4 @@ "main": "src-build/index.js", | ||
"moment": "^2.10.6", | ||
"simple-debugger": "^1.0.3" | ||
"simple-debugger": "^1.0.3", | ||
"uncolor": "^0.4.0" | ||
}, | ||
@@ -35,0 +36,0 @@ "devDependencies": { |
@@ -49,3 +49,4 @@ # bellman | ||
### Events | ||
* `log` - агрументы события: | ||
* `log` - в качестве агрумента события используется объет, содержащий: | ||
* `time` - Отформатированную временную метку | ||
* `level` - Имя уровня логирования, соответствует имени логирующего метода | ||
@@ -52,0 +53,0 @@ * `caller` - Имя файла и номер строки на которой был вызван логирующий метод |
@@ -8,3 +8,4 @@ 'use strict';Object.defineProperty(exports, '__esModule', { value: true });var _createClass = (function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};})();var _get = function get(_x4, _x5, _x6) {var _again = true;_function: while (_again) {var object = _x4, property = _x5, receiver = _x6;_again = false;if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) {var parent = Object.getPrototypeOf(object);if (parent === null) {return undefined;} else {_x4 = parent;_x5 = property;_x6 = receiver;_again = true;desc = parent = undefined;continue _function;}} else if ('value' in desc) {return desc.value;} else {var getter = desc.get;if (getter === undefined) {return undefined;}return getter.call(receiver);}}};function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _toConsumableArray(arr) {if (Array.isArray(arr)) {for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];return arr2;} else {return Array.from(arr);}}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError('Cannot call a class as a function');}}function _inherits(subClass, superClass) {if (typeof superClass !== 'function' && superClass !== null) {throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;}var _simpleDebugger = require( | ||
'lodash');var _events = require( | ||
'lodash');var _uncolor = require( | ||
'uncolor');var _uncolor2 = _interopRequireDefault(_uncolor);var _events = require( | ||
'events');var _events2 = _interopRequireDefault(_events);var _chalk = require( | ||
@@ -37,3 +38,3 @@ 'chalk');var _chalk2 = _interopRequireDefault(_chalk);var _moment = require( | ||
function log(level) { | ||
function log(level) {for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {args[_key - 1] = arguments[_key];} | ||
var isForseType = this.opt.levels.indexOf(level) === -1; | ||
@@ -45,3 +46,3 @@ if (isForseType) level = 'info'; | ||
this.getLevelWeight(this.opt.levelMin))) | ||
return this;for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {args[_key - 1] = arguments[_key];} | ||
return this; | ||
@@ -74,4 +75,9 @@ var strArgs = args.map(this.formatValue.bind(this)); | ||
levelLogger(line); | ||
this.emit('log', level, callerPos, message, args); | ||
this.emit('log', { | ||
level: level, args: args, | ||
time: timestamp, | ||
caller: callerPos, | ||
message: (0, _uncolor2['default'])(message) }); | ||
return this;} }, { key: 'formatValue', value: | ||
@@ -78,0 +84,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26227
240
70
5
+ Addeduncolor@^0.4.0
+ Addedcore-util-is@1.0.3(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedreadable-stream@1.1.14(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addeduncolor@0.4.0(transitive)