Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Probe: log crate #8

Open
goodhoko opened this issue Apr 18, 2023 · 2 comments
Open

Probe: log crate #8

goodhoko opened this issue Apr 18, 2023 · 2 comments
Assignees

Comments

@goodhoko
Copy link
Member

No description provided.

@PabloMansanet
Copy link
Member

Implementing a logger is pretty simple; here's the example code provided in the docs:

use log::{Record, Level, Metadata};

struct SimpleLogger;

impl log::Log for SimpleLogger {
    fn enabled(&self, metadata: &Metadata) -> bool {
        metadata.level() <= Level::Info
    }

    fn log(&self, record: &Record) {
        if self.enabled(record.metadata()) {
            println!("{} - {}", record.level(), record.args());
        }
    }

    fn flush(&self) {}
}

It should be easy to create a logger that turns these logged records into events to send to the aggregator.

The specifics will depend on what we define those events to look like, but here are some general ideas on what things we could be watching out for to turn into sound:

  • Frequency of messages of each log level -> frequency of some waves. Clean, nice sine waves for info and debug, but perhaps something a bit more discordant for warnings and errors?
  • Specific clicks for keywords detected on the logs.
  • ... TBD

@goodhoko
Copy link
Member Author

The specifics will depend on what we define those events to look like, but here are some general ideas on what things we could be watching out for to turn into sound: [...]

Yeah, these all sound good. Supposing the event as proposed in #11, the probe could send an event for each log with a quality set based on the log-level: low for debug and high for errors and then pair it up with a sound effect that varies volume based on event frequency and goes from a sine wave to square wave based on the quality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants