Log to stderr by default. (#1266)
Change the default from file-per-thread-logger to pretty-env-logger, which is more common in Rust projects, and change the option from `-d` to `--log-to-files`.
This commit is contained in:
@@ -89,11 +89,11 @@ pub struct RunCommand {
|
||||
impl RunCommand {
|
||||
/// Executes the command.
|
||||
pub fn execute(&self) -> Result<()> {
|
||||
if self.common.debug {
|
||||
pretty_env_logger::init();
|
||||
} else {
|
||||
if self.common.log_to_files {
|
||||
let prefix = "wasmtime.dbg.";
|
||||
init_file_per_thread_logger(prefix);
|
||||
} else {
|
||||
pretty_env_logger::init();
|
||||
}
|
||||
|
||||
let config = self.common.config()?;
|
||||
|
||||
@@ -54,11 +54,11 @@ impl WasmToObjCommand {
|
||||
}
|
||||
|
||||
fn handle_module(&self) -> Result<()> {
|
||||
if self.common.debug {
|
||||
pretty_env_logger::init();
|
||||
} else {
|
||||
if self.common.log_to_files {
|
||||
let prefix = "wasm2obj.dbg.";
|
||||
init_file_per_thread_logger(prefix);
|
||||
} else {
|
||||
pretty_env_logger::init();
|
||||
}
|
||||
|
||||
let cache_config = if self.common.disable_cache {
|
||||
|
||||
@@ -26,11 +26,11 @@ pub struct WastCommand {
|
||||
impl WastCommand {
|
||||
/// Executes the command.
|
||||
pub fn execute(&self) -> Result<()> {
|
||||
if self.common.debug {
|
||||
pretty_env_logger::init();
|
||||
} else {
|
||||
if self.common.log_to_files {
|
||||
let prefix = "wast.dbg.";
|
||||
init_file_per_thread_logger(prefix);
|
||||
} else {
|
||||
pretty_env_logger::init();
|
||||
}
|
||||
|
||||
let config = self.common.config()?;
|
||||
|
||||
@@ -88,9 +88,9 @@ struct CommonOptions {
|
||||
#[structopt(long, conflicts_with = "lightbeam")]
|
||||
cranelift: bool,
|
||||
|
||||
/// Enable debug output
|
||||
#[structopt(short, long)]
|
||||
debug: bool,
|
||||
/// Log to per-thread log files instead of stderr.
|
||||
#[structopt(long)]
|
||||
log_to_files: bool,
|
||||
|
||||
/// Generate debug information
|
||||
#[structopt(short = "g")]
|
||||
|
||||
Reference in New Issue
Block a user