-
Notifications
You must be signed in to change notification settings - Fork 73
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
Feature: Easier logger override for wrapping Chromatic-node inside an NX-executor #842
Comments
With v7.5.0. we introduced |
Probably not, because we run commands in parallel. Probably this would cause issues. |
Is there maybe any progress to be reported on this issue? |
No progress. It seems you're using the Node API ( const { sessionId = uuid(), env = getEnv(), log = createLogger(), ...extraOptions } = options; Happy to accept a PR for this. Unfortunately I cannot prioritize picking this up myself right now. I can create an internal ticket for it though. |
Hi @ghengeveld , I provided the PR #897 897 |
@work933k Yep, it shipped in 10.8.0. Thanks! |
Feature request
I've created a NX-executor for running Chromatic-node. At this moment the log is written outside of the context of my NX-executor. If i would be able to wrap/capture the output of Chromatic logging. This would allow me to put all output in a single collapsible-panel in the CI-pipeline.
I know that it's possible to capture the output of the Chromatic-cli-version, but then i don't have the detail-output which i now have by using the Chromatic-node.
Proposed solution
If possible: provide an optional logger-parameter in the "run"-function instead of calling createLogger.
https://github.com/chromaui/chromatic-cli/blob/526c06583a3f0388583f320f5446c8a74838a1ff/node-src/index.ts#L79C13-L79C13
Alternative solutions
I tried to override "console.log/console.error/...", but that resulted in a stack-overflow. Probably because the logger wrote to itself and caused recursion.
I think i could also copy the "run"-function and tweak it., before calling the runAll-function. But that's quite a dirty hack.
Additional context
Below is the code of my custom executor. In the executor i check for the result of Chromatic and write a special error-string to the console for Azure DevOps. This special string will become visible in the build-run-overview, which is more user-friendly.
The text was updated successfully, but these errors were encountered: