diff options
author | Andrew Gallant <jamslam@gmail.com> | 2019-04-25 07:20:24 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2019-05-29 18:07:03 -0400 |
commit | 7bf7ceb5d3953a38a6fad45110af2e4117c778ca (patch) | |
tree | c0c664902040c3594046130b8afc9a30e1bbec23 /src/logger.rs | |
parent | 7d3f79458891d2cb9ce2b3d51f8d8f788d36c9e8 (diff) |
progressag/snafu
Diffstat (limited to 'src/logger.rs')
-rw-r--r-- | src/logger.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/logger.rs b/src/logger.rs index f12f0b19..bf3f677c 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -4,6 +4,9 @@ // for this functionality. use log::{self, Log}; +use snafu::ResultExt; + +use crate::err::{self, Result}; /// The simplest possible logger that logs to stderr. /// @@ -18,8 +21,8 @@ impl Logger { /// Create a new logger that logs to stderr and initialize it as the /// global logger. If there was a problem setting the logger, then an /// error is returned. - pub fn init() -> Result<(), log::SetLoggerError> { - log::set_logger(LOGGER) + pub fn init() -> Result<()> { + log::set_logger(LOGGER).eager_context(err::LoggerInit) } } |