-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New logger subsystem (Bunyan) #835
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- We should merge
detox-common
anddetox-server
intodetox
. - 🎉
} | ||
|
||
async onTerminate() { | ||
if (this._artifactPlugins.length === 0) { | ||
return; | ||
} | ||
|
||
log.info('ArtifactsManager', 'finalizing all artifacts, this can take some time'); | ||
log.info({ event: 'ARTIFACTS_FINALIZATION_START' }, 'finalizing the recorded artifacts...'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"this can take some time"
await this._emit('onTerminate', []); | ||
await Promise.all(this._onIdleCallbacks.splice(0).map(this._executeIdleCallback)); | ||
await this._idlePromise; | ||
|
||
await Promise.all(this._activeArtifacts.map(artifact => artifact.discard())); | ||
await this._idlePromise; | ||
this._artifactPlugins.splice(0); | ||
log.info('ArtifactsManager', 'finalized all artifacts'); | ||
log.trace({ event: 'ARTIFACTS_FINALIZED' }, 'done'); | ||
} | ||
|
||
async _emit(methodName, args) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add logger inside emit instead of duplicating across ArtifactsManager.js
@@ -68,18 +73,21 @@ class SimulatorLogRecording extends Artifact { | |||
|
|||
_close() { | |||
if (this._logStream) { |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
detox/src/index.js
Outdated
@@ -1,9 +1,11 @@ | |||
const _ = require('lodash'); | |||
const fs = require('fs'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused, can remove this line
bf9cd5d
to
0b7142e
Compare
This thread has been automatically locked to prevent bumping of old threads. Instead, if you believe the issue still reproduces, please open a new issue and provide all the required information. |
Changeset:
detox-server
is merged insidedetox
package.--record-logs
value is set toall
orfailing
, Detox also saves console logs as a pair of plain-text and JSON files in the location specified by--artifacts-location
parameter. And now you can query JSON log files byjq
,bunyan
and similar tools.bunyan
andbunyan-debug-stream
, some parts of log messages that have been swallowed by Jest previously, now are perfectly visible in a command line.detox.init()
, the build logs an error and exits. It makes build logs more compact and reasonable as the Jest behavior is to continue even whenbeforeAll
fails. Although this is a hack, but it is marked with a todo item.verbose
,silly
andwss
are deprecated. New--no-color
option.loglevel
andno-color
params.--loglevel info
(default)Before
After
--loglevel verbose
(default)Before
After