Comparing version 2.1.1 to 2.1.2
"use strict"; | ||
for (var i = 0; i < 1 * 1000 * 1000; i++) { | ||
for (let i = 0; i < 1 * 1000 * 1000; i++) { | ||
// eslint-disable-next-line no-console | ||
@@ -5,0 +5,0 @@ console.log(String(i)); |
@@ -1,18 +0,11 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _createWriter = require('../factories/createWriter'); | ||
var _createWriter = _interopRequireDefault(require("../factories/createWriter")); | ||
var _createWriter2 = _interopRequireDefault(_createWriter); | ||
var _createRoarrInititialGlobalState = _interopRequireDefault(require("../factories/createRoarrInititialGlobalState")); | ||
var _createRoarrInititialGlobalState = require('../factories/createRoarrInititialGlobalState'); | ||
var _createRoarrInititialGlobalState2 = _interopRequireDefault(_createRoarrInititialGlobalState); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// @flow | ||
global.ROARR = (0, _createRoarrInititialGlobalState2.default)({}); | ||
var Writer = (0, _createWriter2.default)({ | ||
global.ROARR = (0, _createRoarrInititialGlobalState.default)({}); | ||
const Writer = (0, _createWriter.default)({ | ||
bufferSize: 1024 * 8, | ||
@@ -22,5 +15,5 @@ stream: 'STDOUT' | ||
for (var i = 0; i < 1 * 1000 * 1000; i++) { | ||
for (let i = 0; i < 1 * 1000 * 1000; i++) { | ||
Writer.write(String(i)); | ||
} | ||
//# sourceMappingURL=roarr.js.map |
"use strict"; | ||
for (var i = 0; i < 1 * 1000 * 1000; i++) { | ||
for (let i = 0; i < 1 * 1000 * 1000; i++) { | ||
process.stdout.write(String(i)); | ||
} | ||
//# sourceMappingURL=write.js.map |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,33 +6,22 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.handler = exports.builder = exports.desc = exports.command = undefined; | ||
exports.handler = exports.builder = exports.desc = exports.command = void 0; | ||
var _os = require('os'); | ||
var _os = _interopRequireDefault(require("os")); | ||
var _os2 = _interopRequireDefault(_os); | ||
var _split = _interopRequireDefault(require("split2")); | ||
var _split = require('split2'); | ||
var _ulid = require("ulid"); | ||
var _split2 = _interopRequireDefault(_split); | ||
var _utilities = require("./utilities"); | ||
var _ulid = require('ulid'); | ||
var _utilities = require('./utilities'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// @flow | ||
const command = 'augment'; | ||
exports.command = command; | ||
const desc = 'Augments Roarr logs with additional information.'; | ||
exports.desc = desc; | ||
var command = exports.command = 'augment'; | ||
var desc = exports.desc = 'Augments Roarr logs with additional information.'; | ||
const createLogFormatter = configuration => { | ||
let instanceId; | ||
/*:: type LogFormatterConfigurationType = {| | ||
+appendHostname: boolean, | ||
+appendInstanceId: boolean, | ||
+excludeOrphans: boolean | ||
|};*/ | ||
var createLogFormatter = function createLogFormatter(configuration /*: LogFormatterConfigurationType*/) { | ||
var instanceId = void 0; | ||
if (configuration.appendInstanceId) { | ||
@@ -42,3 +31,3 @@ instanceId = (0, _ulid.ulid)(); | ||
var stream = (0, _split2.default)(function (line) { | ||
const stream = (0, _split.default)(line => { | ||
if (!(0, _utilities.isRoarrLine)(line)) { | ||
@@ -48,6 +37,6 @@ return configuration.excludeOrphans ? '' : line + '\n'; | ||
var message = JSON.parse(line); | ||
const message = JSON.parse(line); | ||
if (configuration.appendHostname) { | ||
message.context.hostname = _os2.default.hostname(); | ||
message.context.hostname = _os.default.hostname(); | ||
} | ||
@@ -61,8 +50,7 @@ | ||
}); | ||
return stream; | ||
}; | ||
}; // eslint-disable-next-line flowtype/no-weak-types | ||
// eslint-disable-next-line flowtype/no-weak-types | ||
var builder = exports.builder = function builder(yargs /*: Object*/) { | ||
const builder = yargs => { | ||
return yargs.options({ | ||
@@ -83,8 +71,12 @@ 'append-hostname': { | ||
}); | ||
}; | ||
}; // eslint-disable-next-line flowtype/no-weak-types | ||
// eslint-disable-next-line flowtype/no-weak-types | ||
var handler = exports.handler = function handler(argv /*: Object*/) { | ||
exports.builder = builder; | ||
const handler = argv => { | ||
process.stdin.pipe(createLogFormatter(argv)).pipe(process.stdout); | ||
}; | ||
exports.handler = handler; | ||
//# sourceMappingURL=augment.js.map |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,27 +6,21 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.handler = exports.builder = exports.desc = exports.command = undefined; | ||
exports.handler = exports.builder = exports.desc = exports.command = void 0; | ||
var _split = require('split2'); | ||
var _split = _interopRequireDefault(require("split2")); | ||
var _split2 = _interopRequireDefault(_split); | ||
var _chalk = _interopRequireDefault(require("chalk")); | ||
var _chalk = require('chalk'); | ||
var _prettyjson = _interopRequireDefault(require("prettyjson")); | ||
var _chalk2 = _interopRequireDefault(_chalk); | ||
var _utilities = require("./utilities"); | ||
var _prettyjson = require('prettyjson'); | ||
var _prettyjson2 = _interopRequireDefault(_prettyjson); | ||
var _utilities = require('./utilities'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } // @flow | ||
const command = 'pretty-print'; | ||
exports.command = command; | ||
const desc = 'Format logs for user-inspection.'; | ||
/* eslint-disable quote-props */ | ||
var command = exports.command = 'pretty-print'; | ||
var desc = exports.desc = 'Format logs for user-inspection.'; | ||
/* eslint-disable quote-props */ | ||
var logLevels = { | ||
exports.desc = desc; | ||
const logLevels = { | ||
'10': 'TRACE', | ||
@@ -41,23 +35,17 @@ '20': 'DEBUG', | ||
var logLevelColorMap = { | ||
DEBUG: _chalk2.default.gray, | ||
ERROR: _chalk2.default.red, | ||
FATAL: _chalk2.default.red, | ||
INFO: _chalk2.default.cyan, | ||
TRACE: _chalk2.default.gray, | ||
WARN: _chalk2.default.yellow | ||
const logLevelColorMap = { | ||
DEBUG: _chalk.default.gray, | ||
ERROR: _chalk.default.red, | ||
FATAL: _chalk.default.red, | ||
INFO: _chalk.default.cyan, | ||
TRACE: _chalk.default.gray, | ||
WARN: _chalk.default.yellow | ||
}; | ||
var getLogLevelName = function getLogLevelName(logLevel /*: number*/) /*: string*/ { | ||
const getLogLevelName = logLevel => { | ||
return logLevels[logLevel] || 'INFO'; | ||
}; | ||
/*:: type LogFormatterConfigurationType = {| | ||
+includeContext: boolean, | ||
+excludeOrphans: boolean | ||
|};*/ | ||
var createLogFormatter = function createLogFormatter(configuration /*: LogFormatterConfigurationType*/) { | ||
var stream = (0, _split2.default)(function (line) { | ||
const createLogFormatter = configuration => { | ||
const stream = (0, _split.default)(line => { | ||
if (!(0, _utilities.isRoarrLine)(line)) { | ||
@@ -67,13 +55,10 @@ return configuration.excludeOrphans ? '' : line + '\n'; | ||
var message = JSON.parse(line); | ||
var formattedMessage = ''; | ||
const message = JSON.parse(line); | ||
let formattedMessage = ''; | ||
formattedMessage = '[' + new Date(message.time).toISOString() + ']'; | ||
if (message.context.logLevel && typeof message.context.logLevel === 'number') { | ||
var logLevelName = getLogLevelName(message.context.logLevel); | ||
const logLevelName = getLogLevelName(message.context.logLevel); | ||
const logLevelColorName = logLevelColorMap[logLevelName]; | ||
var logLevelColorName = logLevelColorMap[logLevelName]; | ||
if (!logLevelColorName) { | ||
@@ -98,12 +83,12 @@ throw new Error('Unexpected state.'); | ||
/* eslint-disable no-unused-vars */ | ||
var _message$context = message.context, | ||
tmp0 = _message$context.application, | ||
tmp1 = _message$context.hostname, | ||
tmp2 = _message$context.instanceId, | ||
tmp3 = _message$context.logLevel, | ||
tmp4 = _message$context.namespace, | ||
tmp5 = _message$context.package, | ||
tmp6 = _message$context.package, | ||
rest = _objectWithoutProperties(_message$context, ['application', 'hostname', 'instanceId', 'logLevel', 'namespace', 'package', 'package']); | ||
const { | ||
application: tmp0, | ||
hostname: tmp1, | ||
instanceId: tmp2, | ||
logLevel: tmp3, | ||
namespace: tmp4, | ||
package: tmp5, | ||
package: tmp6, | ||
...rest | ||
} = message.context; | ||
/* eslint-enable */ | ||
@@ -113,3 +98,3 @@ | ||
// eslint-disable-next-line no-console | ||
formattedMessage += _prettyjson2.default.render(rest) + '\n\n'; | ||
formattedMessage += _prettyjson.default.render(rest) + '\n\n'; | ||
} | ||
@@ -120,8 +105,7 @@ } | ||
}); | ||
return stream; | ||
}; | ||
}; // eslint-disable-next-line flowtype/no-weak-types | ||
// eslint-disable-next-line flowtype/no-weak-types | ||
var builder = exports.builder = function builder(yargs /*: Object*/) { | ||
const builder = yargs => { | ||
return yargs.options({ | ||
@@ -140,6 +124,9 @@ 'exclude-orphans': { | ||
// eslint-disable-next-line flowtype/no-weak-types | ||
var handler = exports.handler = function handler(argv /*: Object*/) { | ||
exports.builder = builder; | ||
const handler = argv => { | ||
process.stdin.pipe(createLogFormatter(argv)).pipe(process.stdout); | ||
}; | ||
exports.handler = handler; | ||
//# sourceMappingURL=pretty-print.js.map |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,13 +6,12 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
var _isRoarrLine = require('./isRoarrLine'); | ||
Object.defineProperty(exports, 'isRoarrLine', { | ||
Object.defineProperty(exports, "isRoarrLine", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_isRoarrLine).default; | ||
get: function () { | ||
return _isRoarrLine.default; | ||
} | ||
}); | ||
var _isRoarrLine = _interopRequireDefault(require("./isRoarrLine")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
// @flow | ||
exports.default = function (text /*: string*/) /*: boolean*/ { | ||
var _default = text => { | ||
return text.includes('"message"') && text.includes('"sequence"'); | ||
}; | ||
exports.default = _default; | ||
//# sourceMappingURL=isRoarrLine.js.map |
#!/usr/bin/env node | ||
'use strict'; | ||
"use strict"; | ||
var _yargs = require('yargs'); | ||
var _yargs = _interopRequireDefault(require("yargs")); | ||
var _yargs2 = _interopRequireDefault(_yargs); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
_yargs2.default.env('ROARR').commandDir('commands').help().wrap(80).parse(); | ||
_yargs.default.env('ROARR').commandDir('commands').help().wrap(80).parse(); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,24 +6,19 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.ROARR_STREAM = exports.ROARR_LOG = exports.ROARR_BUFFER_SIZE = undefined; | ||
exports.ROARR_STREAM = exports.ROARR_LOG = exports.ROARR_BUFFER_SIZE = void 0; | ||
var _boolean = require('boolean'); | ||
var _boolean = _interopRequireDefault(require("boolean")); | ||
var _boolean2 = _interopRequireDefault(_boolean); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var ROARR_BUFFER_SIZE = process.env.ROARR_BUFFER_SIZE === undefined ? 1024 * 8 : parseInt(process.env.ROARR_BUFFER_SIZE, 10); // @flow | ||
/* eslint-disable no-process-env */ | ||
const ROARR_BUFFER_SIZE = process.env.ROARR_BUFFER_SIZE === undefined ? 1024 * 8 : parseInt(process.env.ROARR_BUFFER_SIZE, 10); | ||
exports.ROARR_BUFFER_SIZE = ROARR_BUFFER_SIZE; | ||
const ROARR_LOG = (0, _boolean.default)(process.env.ROARR_LOG) === true; | ||
exports.ROARR_LOG = ROARR_LOG; | ||
const ROARR_STREAM = (process.env.ROARR_STREAM || 'STDOUT').toUpperCase(); | ||
exports.ROARR_STREAM = ROARR_STREAM; | ||
var ROARR_LOG = (0, _boolean2.default)(process.env.ROARR_LOG) === true; | ||
var ROARR_STREAM = (process.env.ROARR_STREAM || 'STDOUT').toUpperCase(); | ||
if (ROARR_STREAM !== 'STDOUT' && ROARR_STREAM !== 'STDERR') { | ||
throw new Error('Unexpected ROARR_STREAM value.'); | ||
} | ||
exports.ROARR_BUFFER_SIZE = ROARR_BUFFER_SIZE; | ||
exports.ROARR_LOG = ROARR_LOG; | ||
exports.ROARR_STREAM = ROARR_STREAM; | ||
//# sourceMappingURL=config.js.map |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,18 +6,8 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // @flow | ||
var _sprintfJs = require("sprintf-js"); | ||
var _sprintfJs = require('sprintf-js'); | ||
/*:: import type { | ||
LoggerType, | ||
MessageContextType, | ||
MessageType | ||
} from '../types';*/ | ||
/*:: type OnMessageEventHandlerType = (message: MessageType) => void;*/ | ||
var version = '1.0.0'; | ||
var logLevels = { | ||
const version = '1.0.0'; | ||
const logLevels = { | ||
debug: 20, | ||
@@ -31,15 +21,14 @@ error: 50, | ||
var createLogger = function createLogger(onMessage /*: OnMessageEventHandlerType*/) { | ||
var parentContext /*: MessageContextType*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
const createLogger = (onMessage, parentContext = {}) => { | ||
// eslint-disable-next-line id-length | ||
var log /*: LoggerType*/ = function log(a, b, c, d, e, f, g, h, i, k) { | ||
var time = Date.now(); | ||
var sequence = global.ROARR.sequence++; | ||
const log = (a, b, c, d, e, f, g, h, i, k) => { | ||
const time = Date.now(); | ||
const sequence = global.ROARR.sequence++; | ||
let context; | ||
let message; | ||
var context = void 0; | ||
var message = void 0; | ||
if (typeof a === 'string') { | ||
context = _extends({}, global.ROARR.prepend, parentContext); | ||
context = { ...global.ROARR.prepend, | ||
...parentContext | ||
}; | ||
message = (0, _sprintfJs.sprintf)(a, b, c, d, e, f, g, h, i, k); | ||
@@ -51,4 +40,6 @@ } else { | ||
context = _extends({}, global.ROARR.prepend, parentContext, a); | ||
context = { ...global.ROARR.prepend, | ||
...parentContext, | ||
...a | ||
}; | ||
message = (0, _sprintfJs.sprintf)(b, c, d, e, f, g, h, i, k); | ||
@@ -58,19 +49,21 @@ } | ||
onMessage({ | ||
context: context, | ||
message: message, | ||
sequence: sequence, | ||
time: time, | ||
version: version | ||
context, | ||
message, | ||
sequence, | ||
time, | ||
version | ||
}); | ||
}; | ||
log.child = function (context /*: MessageContextType*/) { | ||
return createLogger(onMessage, _extends({}, parentContext, context)); | ||
log.child = context => { | ||
return createLogger(onMessage, { ...parentContext, | ||
...context | ||
}); | ||
}; | ||
var logLevelNames = Object.keys(logLevels); | ||
const logLevelNames = Object.keys(logLevels); | ||
var _loop = function _loop(logLevelName) { | ||
for (const logLevelName of logLevelNames) { | ||
// eslint-disable-next-line id-length | ||
log[logLevelName] = function (a, b, c, d, e, f, g, h, i, k) { | ||
log[logLevelName] = (a, b, c, d, e, f, g, h, i, k) => { | ||
return log.child({ | ||
@@ -80,27 +73,2 @@ logLevel: logLevels[logLevelName] | ||
}; | ||
}; | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
try { | ||
for (var _iterator = logLevelNames[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var logLevelName = _step.value; | ||
_loop(logLevelName); | ||
} | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator.return) { | ||
_iterator.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
} | ||
@@ -111,3 +79,4 @@ | ||
exports.default = createLogger; | ||
var _default = createLogger; | ||
exports.default = _default; | ||
//# sourceMappingURL=createLogger.js.map |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,31 +6,20 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // @flow | ||
var _semverCompare = _interopRequireDefault(require("semver-compare")); | ||
var _semverCompare = require('semver-compare'); | ||
var _package = require("../../package.json"); | ||
var _semverCompare2 = _interopRequireDefault(_semverCompare); | ||
var _config = require("../config"); | ||
var _package = require('../../package.json'); | ||
var _createWriter = _interopRequireDefault(require("./createWriter")); | ||
var _config = require('../config'); | ||
var _createWriter = require('./createWriter'); | ||
var _createWriter2 = _interopRequireDefault(_createWriter); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/*:: import type { | ||
RoarrGlobalStateType | ||
} from '../types';*/ | ||
// eslint-disable-next-line flowtype/no-weak-types | ||
exports.default = function (currentState /*: Object*/) /*: RoarrGlobalStateType*/ { | ||
var versions = (currentState.versions || []).concat(); | ||
var _default = currentState => { | ||
const versions = (currentState.versions || []).concat(); | ||
versions.sort(_semverCompare.default); | ||
const currentIsLatestVersion = !versions.length || (0, _semverCompare.default)(_package.version, versions[versions.length - 1]) === 1; | ||
versions.sort(_semverCompare2.default); | ||
var currentIsLatestVersion = !versions.length || (0, _semverCompare2.default)(_package.version, versions[versions.length - 1]) === 1; | ||
if (!versions.includes(_package.version)) { | ||
@@ -40,18 +29,16 @@ versions.push(_package.version); | ||
versions.sort(_semverCompare2.default); | ||
var newState = _extends({ | ||
versions.sort(_semverCompare.default); | ||
const newState = { | ||
buffer: '', | ||
prepend: {}, | ||
sequence: 0 | ||
}, currentState, { | ||
versions: versions | ||
}); | ||
sequence: 0, | ||
...currentState, | ||
versions | ||
}; | ||
if (currentIsLatestVersion || !newState.write) { | ||
var Writer = (0, _createWriter2.default)({ | ||
const Writer = (0, _createWriter.default)({ | ||
bufferSize: _config.ROARR_BUFFER_SIZE, | ||
stream: _config.ROARR_STREAM | ||
}); | ||
newState.write = Writer.write; | ||
@@ -63,2 +50,4 @@ newState.flush = Writer.flush; | ||
}; | ||
exports.default = _default; | ||
//# sourceMappingURL=createRoarrInititialGlobalState.js.map |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,19 +6,14 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
// @flow | ||
exports.default = void 0; | ||
// @todo Add browser support. | ||
/*:: type WriteConfigurationType = {| | ||
+bufferSize: number, | ||
+stream: 'STDOUT' | 'STDERR' | ||
|};*/ | ||
var _default = configuration => { | ||
const stream = configuration.stream.toUpperCase() === 'STDOUT' ? process.stdout : process.stderr; | ||
const write = stream.write.bind(stream); | ||
exports.default = function (configuration /*: WriteConfigurationType*/) { | ||
var stream = configuration.stream.toUpperCase() === 'STDOUT' ? process.stdout : process.stderr; | ||
var _write = stream.write.bind(stream); | ||
if (!configuration.bufferSize) { | ||
return { | ||
flush: function flush() {}, | ||
write: function write(message /*: string*/) { | ||
_write(message + '\n'); | ||
flush: () => {}, | ||
write: message => { | ||
write(message + '\n'); | ||
} | ||
@@ -28,3 +23,3 @@ }; | ||
var flush = function flush() { | ||
const flush = () => { | ||
if (!global.ROARR.buffer) { | ||
@@ -34,12 +29,10 @@ return; | ||
var buffer = global.ROARR.buffer; | ||
const buffer = global.ROARR.buffer; | ||
global.ROARR.buffer = ''; | ||
_write(buffer); | ||
write(buffer); | ||
}; | ||
return { | ||
flush: flush, | ||
write: function write(message /*: string*/) { | ||
flush, | ||
write: message => { | ||
global.ROARR.buffer += message + '\n'; | ||
@@ -49,8 +42,9 @@ | ||
flush(); | ||
} | ||
} // @todo Write messages when the event loop is not busy. | ||
// @todo Write messages when the event loop is not busy. | ||
} | ||
}; | ||
}; | ||
exports.default = _default; | ||
//# sourceMappingURL=createWriter.js.map |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,22 +6,20 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
var _createLogger = require('./createLogger'); | ||
Object.defineProperty(exports, 'createLogger', { | ||
Object.defineProperty(exports, "createLogger", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_createLogger).default; | ||
get: function () { | ||
return _createLogger.default; | ||
} | ||
}); | ||
var _createRoarrInititialGlobalState = require('./createRoarrInititialGlobalState'); | ||
Object.defineProperty(exports, 'createRoarrInititialGlobalState', { | ||
Object.defineProperty(exports, "createRoarrInititialGlobalState", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_createRoarrInititialGlobalState).default; | ||
get: function () { | ||
return _createRoarrInititialGlobalState.default; | ||
} | ||
}); | ||
var _createLogger = _interopRequireDefault(require("./createLogger")); | ||
var _createRoarrInititialGlobalState = _interopRequireDefault(require("./createRoarrInititialGlobalState")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,17 +6,14 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _factories = require('./factories'); | ||
var _factories = require("./factories"); | ||
var _config = require('./config'); | ||
var _config = require("./config"); | ||
// @flow | ||
global.ROARR = (0, _factories.createRoarrInititialGlobalState)(global.ROARR || {}); // We want to register just one event listener for 'exit' event | ||
// across all instances of Roarr. | ||
global.ROARR = (0, _factories.createRoarrInititialGlobalState)(global.ROARR || {}); | ||
// We want to register just one event listener for 'exit' event | ||
// across all instances of Roarr. | ||
if (!global.ROARR.registeredFlush) { | ||
global.ROARR.registeredFlush = true; | ||
process.on('exit', function () { | ||
process.on('exit', () => { | ||
if (global.ROARR.flush) { | ||
@@ -28,3 +25,3 @@ global.ROARR.flush(); | ||
exports.default = (0, _factories.createLogger)(function (message) { | ||
var _default = (0, _factories.createLogger)(message => { | ||
if (!_config.ROARR_LOG) { | ||
@@ -34,6 +31,7 @@ return; | ||
var body = JSON.stringify(message); | ||
const body = JSON.stringify(message); | ||
global.ROARR.write(body); | ||
}); | ||
exports.default = _default; | ||
//# sourceMappingURL=log.js.map |
"use strict"; | ||
// @flow | ||
/*:: export type SerializableObjectType = { | ||
+[key: string]: string | number | null | SerializableObjectType | ||
};*/ | ||
/*:: export type RoarrGlobalStateType = {| | ||
buffer: string, | ||
flush: (message: string) => void, | ||
prepend: SerializableObjectType, | ||
registeredFlush: boolean, | ||
sequence: number, | ||
versions: $ReadOnlyArray<string>, | ||
write: (message: string) => void | ||
|};*/ | ||
/*:: export type SprintfArgumentType = string | number | boolean | null;*/ | ||
/*:: export type MessageContextType = SerializableObjectType;*/ | ||
/*:: export type MessageType = {| | ||
+context: MessageContextType, | ||
+message: string, | ||
+sequence: number, | ||
+time: number, | ||
+version: string | ||
|};*/ | ||
// eslint-disable-next-line no-redeclare | ||
/*:: declare function Logger ( | ||
context: MessageContextType, | ||
message: string, | ||
c?: SprintfArgumentType, | ||
d?: SprintfArgumentType, | ||
e?: SprintfArgumentType, | ||
f?: SprintfArgumentType, | ||
g?: SprintfArgumentType, | ||
h?: SprintfArgumentType, | ||
i?: SprintfArgumentType, | ||
k?: SprintfArgumentType | ||
): void;*/ | ||
/** | ||
* see https://twitter.com/kuizinas/status/914139352908943360 | ||
*/ | ||
/*:: declare function Logger ( | ||
message: string, | ||
b?: SprintfArgumentType, | ||
c?: SprintfArgumentType, | ||
d?: SprintfArgumentType, | ||
e?: SprintfArgumentType, | ||
f?: SprintfArgumentType, | ||
g?: SprintfArgumentType, | ||
h?: SprintfArgumentType, | ||
i?: SprintfArgumentType, | ||
k?: SprintfArgumentType | ||
): void;*/ | ||
/*:: export type LoggerType = typeof Logger;*/ | ||
//# sourceMappingURL=types.js.map |
@@ -8,5 +8,4 @@ { | ||
"ava": { | ||
"babel": "inherit", | ||
"require": [ | ||
"babel-register" | ||
"@babel/register" | ||
] | ||
@@ -27,10 +26,10 @@ }, | ||
"devDependencies": { | ||
"ava": "^0.23.0", | ||
"babel-cli": "^6.26.0", | ||
"babel-plugin-istanbul": "^4.1.5", | ||
"babel-plugin-transform-flow-comments": "^6.22.0", | ||
"babel-plugin-transform-flow-strip-types": "^6.22.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-register": "^6.26.0", | ||
"@babel/cli": "^7.0.0-beta.46", | ||
"@babel/core": "^7.0.0-beta.46", | ||
"@babel/node": "^7.0.0-beta.46", | ||
"@babel/plugin-transform-flow-strip-types": "^7.0.0-beta.46", | ||
"@babel/preset-env": "^7.0.0-beta.46", | ||
"@babel/register": "^7.0.0-beta.46", | ||
"ava": "^1.0.0-beta.4", | ||
"babel-plugin-istanbul": "^4.1.6", | ||
"coveralls": "^3.0.0", | ||
@@ -66,3 +65,3 @@ "eslint": "^4.10.0", | ||
"require": [ | ||
"babel-register" | ||
"@babel/register" | ||
], | ||
@@ -81,3 +80,3 @@ "sourceMap": false | ||
}, | ||
"version": "2.1.1" | ||
"version": "2.1.2" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
70097
399
1