We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Trying to set the log format for the whole CLI.
At the moment, extra code is required to make the whole CLI output json logs
#!/usr/bin/env node import { Effect, Logger, LogLevel, Option } from 'effect'; import { NodeContext, NodeRuntime } from '@effect/platform-node'; import { Command } from '@effect/cli'; const root = Command.make('my-app').pipe( Command.withSubcommands([...]), ); const cli = Command.run(root, { name: 'my-app', version: '0.0.1', }); cli(process.argv).pipe( Effect.provide(NodeContext.layer), Effect.tapErrorCause((cause) => Effect.logFatal('Failed', cause)), Effect.provide(Logger.json), NodeRuntime.runMain({ disablePrettyLogger: true, disableErrorReporting: true, }), );
The example above
More flexibility around setting the log format for the node runtime. Could look like this, although something pipe-able would probably look nicer
cli(process.argv).pipe( Effect.provide(NodeContext.layer), NodeRuntime.runMain({ logger: Logger.json }), );
Another potential solution would be to add a Log Format ([--log-format]) built-in option to the CLI package.
Log Format ([--log-format])
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What is the problem this feature would solve?
Trying to set the log format for the whole CLI.
At the moment, extra code is required to make the whole CLI output json logs
The example above
What is the feature you are proposing to solve the problem?
More flexibility around setting the log format for the node runtime. Could look like this, although something pipe-able would probably look nicer
Another potential solution would be to add a
Log Format ([--log-format])
built-in option to the CLI package.What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: