Skip to content

Commit

Permalink
#150: Fix tests and improve readme for continous logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
archfz committed Jul 8, 2022
1 parent 726a886 commit a785736
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ before all and after all hooks.

#### `options.enableContinuousLogging`
boolean; default false; Enables logging logs to terminal continuously / immediately as they are registered.
This feature is unstable and has an impact on pipeline performance. Use only for debugging purposes in case
the pipelines / tests are timing out.
This feature is unstable and has an impact on pipeline performance. This option has no effect for extended
collector, only works for the simple collector. Use only for debugging purposes in case the pipelines /
tests are timing out.

> NOTE: In case of this option enabled, logs will come before the actual title of the test. Also the
> `printLogsToConsole` option will be ignored. Logging to files might also get impacted.
Expand Down
2 changes: 2 additions & 0 deletions src/collector/LogCollectExtendedControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module.exports = class LogCollectExtendedControl extends LogCollectBaseControl {
level: testLevel,
consoleTitle: options.consoleTitle,
isHook: options.isHook,
continuous: false,
}
})
// For some reason cypress throws empty error although the task indeed works.
Expand All @@ -84,6 +85,7 @@ module.exports = class LogCollectExtendedControl extends LogCollectBaseControl {
level: testLevel,
consoleTitle: options.consoleTitle,
isHook: options.isHook,
continuous: false,
},
{log: false}
);
Expand Down
2 changes: 1 addition & 1 deletion src/installLogsPrinter.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ function logToTerminal(messages, options, data) {
);
});

if (messages.length !== 0 && data.continuous === false) {
if (messages.length !== 0 && !data.continuous) {
console.log('\n');
}
}
Expand Down

0 comments on commit a785736

Please sign in to comment.