good-console
Installation:

npm: npm install @hapi/good-console

yarn: yarn add @hapi/good-console

Usage

new GoodConsole([config])

Creates a new GoodConsole object with the following arguments:

  • [config] - optional configuration object with the following keys
    • format - MomentJS format string. Defaults to 'YYMMDD/HHmmss.SSS'.
    • utc - boolean controlling Moment using utc mode or not. Defaults to true.
    • color - a boolean specifying whether to output in color. Defaults to true.

Output Formats

Below are example outputs for the designated event type:

  • "ops" - 160318/013330.957, [ops] memory: 29Mb, uptime (seconds): 6, load: [1.650390625,1.6162109375,1.65234375]
  • "error" - 160318/013330.957, [error,event.tags] message: Just a simple error, stack: event.error.stack
  • "request" - 160318/013330.957, [request,event.tags] data: you made a request
  • "log" - 160318/013330.957, [log,event.tags] data: you made a default
  • "response" - 160318/013330.957, [response, event.tags] http://localhost:61253: post /data {"name":"adam"} 200 (150ms)

Changelog

#119
Update joi
#118
Update deps
#115
Change module namespace
8.0.0
breaking changes
#114
Require node v8
#112
Update moment
#107
Update packages
#104
Format errors passed as data to request.log
#103
Use SafeStringify when serializing the query
#102
Revert addition of responseSentTime
7.0.0
breaking changes
#100
Pass event.id for Error and Response format
#95
Add responseSentTime to response format
#98
Upgrade Moment to 2.19.x
#97
Moment Security Advisory
6.4.0
breaking changes
#86
leveraged the error formatter when data is an Error
#85
separated message and stack with a comma
#80
log event.id when available
#78
Bump moment to 2.15.x branch to resolve Regex DOS
#73
update deps
#72
Add newline to output
#71
No newlines after upgrade
6.0.0
breaking changes
#67
Update to new interface of Good and es6
#66
Update depedencies and style. Closes #63 Closes #64
#65
Update to new interface
#64
Update dependencies
#63
ES2015 Updates
#61
package.json: Update moment to 2.11.2
#57
Adds config option to disable colored output
#55
event: Support for `wreck` event from `good`
#53
Fixes node 4 issue. Closes #52.
#52
good-console test not compatible with v4
#50
Add attributes to constructor
#49
Add name
#48
Fixed momentjs deprecation warning. Closes #47.
#47
moment.js deprecation message appearing in logs.
#45
correct the key of the configuration object
#44
Closes #43
5.0.0
breaking changes
#34
Publish 5.0.0
#33
Migrate to use pipes and streams.
#31
UTC Mode
#30
Timezone offset - Disable UTC mode from Momentjs
4.0.0
breaking changes
#29
Rewrote event printing logic to be cleaner
#28
Refactor Output
#27
Added 'log' block.
#26
GoodConsole.prototype._report missing handler for 'log' event
#25
Request Event
#24
Changed unknown event logic
#23
Unknown Events
#22
Update Tag Display
#21
Closes #20
#20
Incorrect internalError reporting
#19
Added Safety Logic
#18
Update Tag Logic
3.0.0
breaking changes
#16
Tag latest
#15
Good updates
#12
Support custom timestamp format, see #6
#9
change this to print out all tags
#6
Support custom timestamp format
#5
Print multiple tags
#4
upgrade to lab 5 and code 1
#3
Version2
#2
peerDependencies
#1
Upgrade good-reporter
clipboard