-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1147: Update logging to use `log`, add command line flag to toggle it r=MarkMcCaskey a=MarkMcCaskey This PR: - ports our logging to the [`log`](https://crates.io/crates/log) crate which is the de-facto standard way to do logging in Rust (it defines a trait which logging backends can implement (we can also implement our own at a later date using these traits)). Another benefit of using the standard logging utilities is that we can now allow users of our libraries to filter and display log messages from Wasmer in a more natural way. - adds a command line flag to enable/disable logging - updates the `debug` and `trace` features to pass the correct static toggles to the `log` crate; judging by the `log` documentation these features need to only be set once - copies and slightly modifies our `fern` configuration from wapm - updates the makefile so that `make release` compiles out all log statements - TODO: update CI to not print with color (may not be necessary actually) # Review - [x] Add a short description of the the change to the CHANGELOG.md file Here's some example output: ``` [1579035881.809 DEBUG wasmer_wasi::state] wasi::fs::inodes [1579035881.809 DEBUG wasmer_wasi::state] wasi::fs::preopen_dirs [1579035881.809 DEBUG wasmer_wasi::state] wasi::fs::mapped_dirs [1579035881.809 DEBUG wasmer_wasi::state] wasi::fs::end [1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::fd_prestat_get: fd=3 [1579035881.810 DEBUG wasmer_wasi::state] in prestat_fd Fd { rights: 536870911, rights_inheriting: 536870911, flags: 0, offset: 0, open_flags: 1, inode: Index { index: 3, generation: 0 } } [1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::fd_prestat_dir_name: fd=3, path_len=2 [1579035881.810 DEBUG wasmer_wasi::syscalls] => result: "/" [1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::fd_fdstat_get: fd=3, buf_ptr=1048536 [1579035881.810 DEBUG wasmer_wasi::state] fdstat: Fd { rights: 536870911, rights_inheriting: 536870911, flags: 0, offset: 0, open_flags: 1, inode: Index { index: 3, generation: 0 } } [1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::fd_prestat_get: fd=4 [1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::environ_sizes_get [1579035881.810 DEBUG wasmer_wasi::syscalls] env_var_count: 0, env_buf_size: 0 [1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::args_sizes_get [1579035881.810 DEBUG wasmer_wasi::syscalls] => argc=3, argv_buf_size=92 [1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::args_get [1579035881.810 DEBUG wasmer_wasi::syscalls] => args: 0: /Users/mark/.wasmer/globals/wapm_packages/mark/[email protected]/wasi-example.wasm 1: -e 2: HQ+ [1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::args_sizes_get [1579035881.811 DEBUG wasmer_wasi::syscalls] => argc=3, argv_buf_size=92 [1579035881.811 DEBUG wasmer_wasi::syscalls] wasi::args_get [1579035881.811 DEBUG wasmer_wasi::syscalls] => args: 0: /Users/mark/.wasmer/globals/wapm_packages/mark/[email protected]/wasi-example.wasm 1: -e 2: HQ+ [1579035881.811 DEBUG wasmer_wasi::syscalls] wasi::random_get buf_len: 16 [1579035881.811 DEBUG wasmer_wasi::syscalls] wasi::fd_write: fd=1 Hello, world! [1579035881.811 DEBUG wasmer_wasi::syscalls] wasi::fd_write: fd=1 HQ+ ``` Co-authored-by: Mark McCaskey <[email protected]>
- Loading branch information
Showing
25 changed files
with
176 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,5 +46,4 @@ rustc_version = "0.2" | |
wabt = "0.9.1" | ||
|
||
[features] | ||
debug = ["wasmer-runtime-core/debug"] | ||
test = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.