-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Issue #382, pretty print error with null stack (#383) * fix issue #382 pretty print error with null stack * prints stack: "null" when error is a property * errors with a null stack, #382 * Bumped v4.15.4. * added lastTime meta parameter (#385) * Bumped v4.16.0. * Remove CLI and add robust prettifier support * Use required prettifier directly and tweak documentation * Address documentation concerns * Remove chalk * Add bin with deprecation notice * Add URL to deprecation notice * deprecated => removed * Move split2 to dev dependencies * Move asMetaWrapper into Pino and update pretty docs
- Loading branch information
Showing
15 changed files
with
199 additions
and
1,189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,6 @@ | ||
#! /usr/bin/env node | ||
|
||
'use strict' | ||
|
||
var pretty = require('./pretty') | ||
var fs = require('fs') | ||
|
||
module.exports = pretty | ||
|
||
if (arg('-h') || arg('--help')) { | ||
usage().pipe(process.stdout) | ||
} else if (arg('-v') || arg('--version')) { | ||
console.log(require('./package.json').version) | ||
} else { | ||
process.stdin.pipe(pretty({ | ||
timeTransOnly: arg('-t'), | ||
levelFirst: arg('-l'), | ||
forceColor: arg('-c'), | ||
messageKey: argWithParam('-m'), | ||
dateFormat: argWithParam('--dateFormat'), | ||
errorProps: paramToArray(argWithParam('--errorProps')), | ||
errorLikeObjectKeys: paramToArray(argWithParam('--errorLikeObjectKeys')), | ||
localTime: arg('--localTime') | ||
})).pipe(process.stdout) | ||
if (!process.stdin.isTTY && !fs.fstatSync(process.stdin.fd).isFile()) { | ||
process.once('SIGINT', function noOp () {}) | ||
} | ||
} | ||
|
||
function usage () { | ||
var help = require('path').join(__dirname, 'usage.txt') | ||
return fs.createReadStream(help) | ||
} | ||
|
||
function arg (s) { | ||
return !!~process.argv.indexOf(s) | ||
} | ||
|
||
function argWithParam (s) { | ||
if (!arg(s)) { | ||
return | ||
} | ||
var argIndex = process.argv.indexOf(s) + 1 | ||
var argValue = process.argv.length > argIndex && | ||
process.argv[argIndex] | ||
|
||
if (!argValue) { | ||
throw new Error(s + ' flag provided without a string argument') | ||
} | ||
return argValue | ||
} | ||
|
||
function paramToArray (param) { | ||
if (!param) { | ||
return | ||
} | ||
|
||
return param.split(/\s?,\s?/) | ||
} | ||
#!/usr/bin/env node | ||
console.error( | ||
'`pino` cli has been removed. Use `pino-pretty` cli instead.\n' + | ||
'\nSee: https://github.com/pinojs/pino-pretty' | ||
) | ||
process.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.