Skip to content

Commit

Permalink
enabled optional logging
Browse files Browse the repository at this point in the history
* added description about the env variables to README.md
* set version to v1.4.5
[ci-build]
  • Loading branch information
prixt committed Feb 21, 2020
1 parent 8204d7e commit 14b208b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "soundsense-rs"
version = "1.4.4"
version = "1.4.5"
build = "build.rs"
authors = ["prixt <[email protected]>"]
edition = "2018"
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ This pattern will make soundsense-rs ignore any cancallations related to water.

The regex pattern uses the [regex crate](https://docs.rs/regex/) syntax.

## Logging
You can set the following environment variables to set the logging parameters. (Disabled on Windows releases)
* __SOUNDSENSE_RS_LOG__: set the level of logging. _(trace, debug, info, warn, error; default: warn)_
* __SOUNDSENSE_RS_LOG_STYLE__: st the level of the log style. _(always, never; default: always)_

## Dependencies
Linux: libasound2, libgtk-3, libwebkit2gtk-4.0

Expand Down
4 changes: 2 additions & 2 deletions dist/mac/soundsense-rs.app/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
<key>CFBundleDocumentTypes</key>

<key>CFBundleShortVersionString</key>
<string>1.4.4</string>
<string>1.4.5</string>

<key>CFBundleVersion</key>
<string>1.4.4</string>
<string>1.4.5</string>

<key>LSMinimumSystemVersion</key>
<string>10.0.0</string>
Expand Down
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ use std::env;
use std::sync::mpsc::channel;
use std::path::PathBuf;
use regex::Regex;
#[macro_use]
extern crate log;
#[macro_use] extern crate log;

mod sound;
mod ui;
mod message;

fn main() {
env_logger::init();
let env = env_logger::Env::default()
.filter_or("SOUNDSENSE_RS_LOG", "warn")
.write_style_or("SOUNDSENSE_RS_LOG_STYLE", "always");
env_logger::init_from_env(env);
info!("Starting SoundSense-RS");
let args: Vec<String> = env::args().collect();
let mut opts = getopts::Options::new();
Expand Down
1 change: 0 additions & 1 deletion src/sound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ pub struct SoundEntry {
}

pub fn run(sound_rx: Receiver<SoundMessage>, ui_tx: Sender<UIMessage>) {

loop {
info!("(Re)Starting sound thread.");
let mut manager : Option<SoundManager> = None;
Expand Down

0 comments on commit 14b208b

Please sign in to comment.