[snowpatch] [PATCH 0/2] Logging support

Russell Currey ruscur at russell.cc
Tue Jun 14 17:04:47 AEST 2016


This series adds logging to snowpatch.  I have decided to go with
env_logger, since it seems fairly ubiquitous, and it is simple.

Logging can be configured with an environment variable, RUST_LOG, with
the values "trace", "debug", "info", "warn", and "error".  We will
probably want to change this in the future, but it is not too important.
The important thing is that we start using these macros now.  They are
part of Rust's generic logging interface.  We can change implementations
at any time relatively easily, but we can get rid of println today.  That
said, I believe in long-running settings that snowpatch should log to
stdout and be managed as an init system service, so I doubt we'll get rid
of it.

The macros are: !trace !debug !info !warn !error

There is also !log, which uses the default level, which I think we should
avoid.

Some fancy stuff can be provided by env_logger in terms of which module is
logged with what verbosity, which might be useful.  Read about that here:

https://rust-lang-nursery.github.io/log/env_logger/index.html

Russell Currey (2):
  Add env_logger and update dependencies
  Replace print messages with appropriate logging

 Cargo.lock       | 64 ++++++++++++++++++++++++++++++++------------------------
 Cargo.toml       |  6 ++++--
 src/git.rs       |  4 ++--
 src/main.rs      | 49 +++++++++++++++++++++++++++++++------------
 src/patchwork.rs |  4 ++--
 src/settings.rs  |  2 +-
 6 files changed, 82 insertions(+), 47 deletions(-)

-- 
2.8.3



More information about the snowpatch mailing list