diff options
author | Tobias Hunger | 2022-09-20 07:11:30 +0000 |
---|---|---|
committer | GitHub | 2022-09-20 07:11:30 +0000 |
commit | 130793dfd06306d1f9d25c150c2dc456cda3f9ed (patch) | |
tree | 843854ea3bf08c251d440fca7c80303f5150b9b5 /helix-term/src/main.rs | |
parent | 8988c1ecc757bb4d1c2372d8b8a78bae6a1fd85e (diff) |
Add command line parameter to specify log file (#3807)
* Add command line parameter to specify log file
I had the logs of my debug helix mixed in with the logs from the
production helix.
Add a `--log` command line argument to redirect any logs to other
files, making my debugging easier :-)
* Update completion files with `--log` argument
Diffstat (limited to 'helix-term/src/main.rs')
-rw-r--r-- | helix-term/src/main.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs index d21d3e77..726bf9e3 100644 --- a/helix-term/src/main.rs +++ b/helix-term/src/main.rs @@ -67,6 +67,7 @@ FLAGS: -g, --grammar {{fetch|build}} Fetches or builds tree-sitter grammars listed in languages.toml -c, --config <file> Specifies a file to use for configuration -v Increases logging verbosity each use for up to 3 times + --log Specifies a file to use for logging (default file: {}) -V, --version Prints version information --vsplit Splits all given files vertically into different windows @@ -114,6 +115,7 @@ FLAGS: return Ok(0); } + let logpath = args.log_file.as_ref().cloned().unwrap_or(logpath); setup_logging(logpath, args.verbosity).context("failed to initialize logging")?; let config_dir = helix_loader::config_dir(); |