Skip to content

Commit

Permalink
Allow passing LOGGY_STACKS=1.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Feb 15, 2017
1 parent 3ccda29 commit 3f5ef6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -56,7 +56,7 @@ logger.dumpStacks = true; // or color of your choice

Environment variables:

* `LOGGY_STACKS`: default value for `dumpStacks`. Pass `true` to see the stacks.
* `LOGGY_STACKS`: default value for `dumpStacks`. Pass `1` to see the stacks.
* `FORCE_NO_COLOR`: disables color output in `chalk`. Does not affect `logger.colors`.

Methods:
Expand Down
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -18,7 +18,7 @@ const prettifyErrors = err => {

const bell = '\x07';
const initTime = today();
const stackSuppressed = chalk.gray('\nStack trace was suppressed. Run with `LOGGY_STACKS=true` to see the trace.');
const stackSuppressed = chalk.gray('\nStack trace was suppressed. Run with `LOGGY_STACKS=1` to see the trace.');

const logger = {
// Enables or disables system notifications for errors.
Expand All @@ -42,7 +42,7 @@ const logger = {
errorHappened: false,

// Dump stacks on errors
dumpStacks: process.env.LOGGY_STACKS === 'true',
dumpStacks: process.env.LOGGY_STACKS === 'true' || process.env.LOGGY_STACKS === '1',

// Creates new colored log entry. Example:
// logger.format('warn') // => '08:59:45 - warn:'
Expand Down

0 comments on commit 3f5ef6c

Please sign in to comment.