Skip to content
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

switch default log level to "error", add -v to run #288

Merged
merged 2 commits into from
Jul 19, 2023

Conversation

joeshaw
Copy link
Member

@joeshaw joeshaw commented Jul 17, 2023

The previous default log level was "off", which meant that errors
encountered during startup with viceroy run were not printed and the
process silently failed. For example, this might happen if you had an
invalid path in your fastly.toml file.

In addition, there was no way to turn on verbose log output with
viceroy run, only in serve mode.

This commit moves the default log level to "error", and moves the -v
flag into the common set.

Making "error" the default meant that processes that called proc_exit
would print WASM stacktraces as errors on exit, but this isn't really an
error from the user's perspective, so we check for that (I32Exit) and
suppress the error message in that case only.

The previous default log level was "off", which meant that errors
encountered during startup with `viceroy run` were not printed and the
process silently failed.  For example, this might happen if you had an
invalid path in your `fastly.toml` file.

In addition, there was no way to turn on verbose log output with
`viceroy run`, only in serve mode.

This commit moves the default log level to "error", and moves the `-v`
flag into the common set.

Making "error" the default meant that processes that called `proc_exit`
would print WASM stacktraces as errors on exit, but this isn't really an
error from the user's perspective, so we check for that (`I32Exit`) and
suppress the error message in that case only.
@joeshaw joeshaw requested a review from itsrainy July 17, 2023 16:37
@joeshaw
Copy link
Member Author

joeshaw commented Jul 17, 2023

@itsrainy I tagged you in as a potential reviewer since you were the last person to recently touch this. If you could take a look I'd appreciate it!

@joeshaw joeshaw force-pushed the joeshaw/error-logging branch from 437d155 to 74b14ff Compare July 17, 2023 16:41
Copy link
Contributor

@itsrainy itsrainy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joeshaw this seems good to me! If I remember correctly, the reason we initially had the verbosity be off for run-mode was so that cargo-nextest could parse just the output of the underlying wasm test-binary without it being interspersed with Viceroy's logs. I just ran through a couple of tests with this and it seems like having the default be error also works 👍

@joeshaw joeshaw merged commit 7a8e569 into main Jul 19, 2023
@joeshaw joeshaw deleted the joeshaw/error-logging branch July 19, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants