diff --git a/logger/Cargo.lock b/logger/Cargo.lock new file mode 100644 index 0000000..d372c49 --- /dev/null +++ b/logger/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "logger" +version = "0.1.0" diff --git a/logger/Cargo.toml b/logger/Cargo.toml new file mode 100644 index 0000000..10c8c45 --- /dev/null +++ b/logger/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "logger" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/logger/src/main.rs b/logger/src/main.rs new file mode 100644 index 0000000..c511f6f --- /dev/null +++ b/logger/src/main.rs @@ -0,0 +1,34 @@ +pub trait Logger { + /// Log a message at the given verbosity level. + fn log(&self, verbosity: u8, message: &str); +} + +struct StdoutLogger; + +impl Logger for StdoutLogger { + fn log(&self, verbosity: u8, message: &str) { + println!("verbosity={verbosity}: {message}"); + } +} + +struct VerbosityFilter { + max_verbosity: u8, + inner: StdoutLogger, +} + +impl Logger for VerbosityFilter { + fn log(&self, verbosity: u8, message: &str) { + if verbosity <= self.max_verbosity { + self.inner.log(verbosity, message) + } + } +} + +fn main() { + let logger = VerbosityFilter { + max_verbosity: 3, + inner: StdoutLogger, + }; + logger.log(5, "FYI"); + logger.log(2, "Uhoh"); +} diff --git a/logger/target/.rustc_info.json b/logger/target/.rustc_info.json new file mode 100644 index 0000000..3bcb347 --- /dev/null +++ b/logger/target/.rustc_info.json @@ -0,0 +1 @@ +{"rustc_fingerprint":6732347950899328623,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.78.0 (9b00956e5 2024-04-29) (Alpine Linux 1.78.0-r0)\nbinary: rustc\ncommit-hash: 9b00956e56009bab2aa15d7bff10916599e3d6d6\ncommit-date: 2024-04-29\nhost: x86_64-alpine-linux-musl\nrelease: 1.78.0\nLLVM version: 17.0.6\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/usr\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"musl\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"alpine\"\nunix\n","stderr":""}},"successes":{}} \ No newline at end of file diff --git a/logger/target/CACHEDIR.TAG b/logger/target/CACHEDIR.TAG new file mode 100644 index 0000000..20d7c31 --- /dev/null +++ b/logger/target/CACHEDIR.TAG @@ -0,0 +1,3 @@ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by cargo. +# For information about cache directory tags see https://bford.info/cachedir/ diff --git a/logger/target/debug/.cargo-lock b/logger/target/debug/.cargo-lock new file mode 100644 index 0000000..e69de29 diff --git a/logger/target/debug/.fingerprint/logger-24dda9cfa85dde2e/bin-logger b/logger/target/debug/.fingerprint/logger-24dda9cfa85dde2e/bin-logger new file mode 100644 index 0000000..c9b9126 --- /dev/null +++ b/logger/target/debug/.fingerprint/logger-24dda9cfa85dde2e/bin-logger @@ -0,0 +1 @@ +e93c6c14f8990fed \ No newline at end of file diff --git a/logger/target/debug/.fingerprint/logger-24dda9cfa85dde2e/bin-logger.json b/logger/target/debug/.fingerprint/logger-24dda9cfa85dde2e/bin-logger.json new file mode 100644 index 0000000..45c7941 --- /dev/null +++ b/logger/target/debug/.fingerprint/logger-24dda9cfa85dde2e/bin-logger.json @@ -0,0 +1 @@ +{"rustc":527819051023801553,"features":"[]","declared_features":"","target":16938823611516788830,"profile":11597332650809196192,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/logger-24dda9cfa85dde2e/dep-bin-logger"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/logger/target/debug/.fingerprint/logger-24dda9cfa85dde2e/dep-bin-logger b/logger/target/debug/.fingerprint/logger-24dda9cfa85dde2e/dep-bin-logger new file mode 100644 index 0000000..5fdf103 Binary files /dev/null and b/logger/target/debug/.fingerprint/logger-24dda9cfa85dde2e/dep-bin-logger differ diff --git a/logger/target/debug/.fingerprint/logger-24dda9cfa85dde2e/invoked.timestamp b/logger/target/debug/.fingerprint/logger-24dda9cfa85dde2e/invoked.timestamp new file mode 100644 index 0000000..e00328d --- /dev/null +++ b/logger/target/debug/.fingerprint/logger-24dda9cfa85dde2e/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/logger/target/debug/.fingerprint/logger-25d7fa76bb1e13bd/dep-test-bin-logger b/logger/target/debug/.fingerprint/logger-25d7fa76bb1e13bd/dep-test-bin-logger new file mode 100644 index 0000000..5fdf103 Binary files /dev/null and b/logger/target/debug/.fingerprint/logger-25d7fa76bb1e13bd/dep-test-bin-logger differ diff --git a/logger/target/debug/.fingerprint/logger-25d7fa76bb1e13bd/invoked.timestamp b/logger/target/debug/.fingerprint/logger-25d7fa76bb1e13bd/invoked.timestamp new file mode 100644 index 0000000..e00328d --- /dev/null +++ b/logger/target/debug/.fingerprint/logger-25d7fa76bb1e13bd/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/logger/target/debug/.fingerprint/logger-25d7fa76bb1e13bd/test-bin-logger b/logger/target/debug/.fingerprint/logger-25d7fa76bb1e13bd/test-bin-logger new file mode 100644 index 0000000..2f54ba6 --- /dev/null +++ b/logger/target/debug/.fingerprint/logger-25d7fa76bb1e13bd/test-bin-logger @@ -0,0 +1 @@ +c1fb9f4ae6f812af \ No newline at end of file diff --git a/logger/target/debug/.fingerprint/logger-25d7fa76bb1e13bd/test-bin-logger.json b/logger/target/debug/.fingerprint/logger-25d7fa76bb1e13bd/test-bin-logger.json new file mode 100644 index 0000000..c630931 --- /dev/null +++ b/logger/target/debug/.fingerprint/logger-25d7fa76bb1e13bd/test-bin-logger.json @@ -0,0 +1 @@ +{"rustc":527819051023801553,"features":"[]","declared_features":"","target":16938823611516788830,"profile":11983525691607113661,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/logger-25d7fa76bb1e13bd/dep-test-bin-logger"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/logger/target/debug/.fingerprint/logger-93bf7dd47194b21e/bin-logger b/logger/target/debug/.fingerprint/logger-93bf7dd47194b21e/bin-logger new file mode 100644 index 0000000..3adabe9 --- /dev/null +++ b/logger/target/debug/.fingerprint/logger-93bf7dd47194b21e/bin-logger @@ -0,0 +1 @@ +f8f84ecbc97cbdac \ No newline at end of file diff --git a/logger/target/debug/.fingerprint/logger-93bf7dd47194b21e/bin-logger.json b/logger/target/debug/.fingerprint/logger-93bf7dd47194b21e/bin-logger.json new file mode 100644 index 0000000..a1b35e2 --- /dev/null +++ b/logger/target/debug/.fingerprint/logger-93bf7dd47194b21e/bin-logger.json @@ -0,0 +1 @@ +{"rustc":527819051023801553,"features":"[]","declared_features":"","target":16938823611516788830,"profile":5601947868832436996,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/logger-93bf7dd47194b21e/dep-bin-logger"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/logger/target/debug/.fingerprint/logger-93bf7dd47194b21e/dep-bin-logger b/logger/target/debug/.fingerprint/logger-93bf7dd47194b21e/dep-bin-logger new file mode 100644 index 0000000..5fdf103 Binary files /dev/null and b/logger/target/debug/.fingerprint/logger-93bf7dd47194b21e/dep-bin-logger differ diff --git a/logger/target/debug/.fingerprint/logger-93bf7dd47194b21e/invoked.timestamp b/logger/target/debug/.fingerprint/logger-93bf7dd47194b21e/invoked.timestamp new file mode 100644 index 0000000..e00328d --- /dev/null +++ b/logger/target/debug/.fingerprint/logger-93bf7dd47194b21e/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/logger/target/debug/deps/liblogger-25d7fa76bb1e13bd.rmeta b/logger/target/debug/deps/liblogger-25d7fa76bb1e13bd.rmeta new file mode 100644 index 0000000..e69de29 diff --git a/logger/target/debug/deps/liblogger-93bf7dd47194b21e.rmeta b/logger/target/debug/deps/liblogger-93bf7dd47194b21e.rmeta new file mode 100644 index 0000000..e69de29 diff --git a/logger/target/debug/deps/logger-24dda9cfa85dde2e b/logger/target/debug/deps/logger-24dda9cfa85dde2e new file mode 100755 index 0000000..8c8c754 Binary files /dev/null and b/logger/target/debug/deps/logger-24dda9cfa85dde2e differ diff --git a/logger/target/debug/deps/logger-24dda9cfa85dde2e.d b/logger/target/debug/deps/logger-24dda9cfa85dde2e.d new file mode 100644 index 0000000..0b1d5a2 --- /dev/null +++ b/logger/target/debug/deps/logger-24dda9cfa85dde2e.d @@ -0,0 +1,5 @@ +/home/caskd/Sources/Repositories/Personal/Rust/logger/target/debug/deps/logger-24dda9cfa85dde2e: src/main.rs + +/home/caskd/Sources/Repositories/Personal/Rust/logger/target/debug/deps/logger-24dda9cfa85dde2e.d: src/main.rs + +src/main.rs: diff --git a/logger/target/debug/deps/logger-25d7fa76bb1e13bd.d b/logger/target/debug/deps/logger-25d7fa76bb1e13bd.d new file mode 100644 index 0000000..fa3651c --- /dev/null +++ b/logger/target/debug/deps/logger-25d7fa76bb1e13bd.d @@ -0,0 +1,5 @@ +/home/caskd/Sources/Repositories/Personal/Rust/logger/target/debug/deps/liblogger-25d7fa76bb1e13bd.rmeta: src/main.rs + +/home/caskd/Sources/Repositories/Personal/Rust/logger/target/debug/deps/logger-25d7fa76bb1e13bd.d: src/main.rs + +src/main.rs: diff --git a/logger/target/debug/deps/logger-93bf7dd47194b21e.d b/logger/target/debug/deps/logger-93bf7dd47194b21e.d new file mode 100644 index 0000000..f57af01 --- /dev/null +++ b/logger/target/debug/deps/logger-93bf7dd47194b21e.d @@ -0,0 +1,5 @@ +/home/caskd/Sources/Repositories/Personal/Rust/logger/target/debug/deps/liblogger-93bf7dd47194b21e.rmeta: src/main.rs + +/home/caskd/Sources/Repositories/Personal/Rust/logger/target/debug/deps/logger-93bf7dd47194b21e.d: src/main.rs + +src/main.rs: diff --git a/logger/target/debug/incremental/logger-26buz5y2tv6y9/s-h1hrplsjge-gdr3wr-86nigz6lcj3fz4hp59n0dzv7j/dep-graph.bin b/logger/target/debug/incremental/logger-26buz5y2tv6y9/s-h1hrplsjge-gdr3wr-86nigz6lcj3fz4hp59n0dzv7j/dep-graph.bin new file mode 100644 index 0000000..017ae0c Binary files /dev/null and b/logger/target/debug/incremental/logger-26buz5y2tv6y9/s-h1hrplsjge-gdr3wr-86nigz6lcj3fz4hp59n0dzv7j/dep-graph.bin differ diff --git a/logger/target/debug/incremental/logger-26buz5y2tv6y9/s-h1hrplsjge-gdr3wr-86nigz6lcj3fz4hp59n0dzv7j/query-cache.bin b/logger/target/debug/incremental/logger-26buz5y2tv6y9/s-h1hrplsjge-gdr3wr-86nigz6lcj3fz4hp59n0dzv7j/query-cache.bin new file mode 100644 index 0000000..eca9177 Binary files /dev/null and b/logger/target/debug/incremental/logger-26buz5y2tv6y9/s-h1hrplsjge-gdr3wr-86nigz6lcj3fz4hp59n0dzv7j/query-cache.bin differ diff --git a/logger/target/debug/incremental/logger-26buz5y2tv6y9/s-h1hrplsjge-gdr3wr-86nigz6lcj3fz4hp59n0dzv7j/work-products.bin b/logger/target/debug/incremental/logger-26buz5y2tv6y9/s-h1hrplsjge-gdr3wr-86nigz6lcj3fz4hp59n0dzv7j/work-products.bin new file mode 100644 index 0000000..19b7715 Binary files /dev/null and b/logger/target/debug/incremental/logger-26buz5y2tv6y9/s-h1hrplsjge-gdr3wr-86nigz6lcj3fz4hp59n0dzv7j/work-products.bin differ diff --git a/logger/target/debug/incremental/logger-26buz5y2tv6y9/s-h1hrplsjge-gdr3wr.lock b/logger/target/debug/incremental/logger-26buz5y2tv6y9/s-h1hrplsjge-gdr3wr.lock new file mode 100644 index 0000000..e69de29 diff --git a/logger/target/debug/incremental/logger-2w2zycuzpvwx7/s-h1hrplsjau-14mpuqm-c96et3fouad2ikl5iboe17k1r/dep-graph.bin b/logger/target/debug/incremental/logger-2w2zycuzpvwx7/s-h1hrplsjau-14mpuqm-c96et3fouad2ikl5iboe17k1r/dep-graph.bin new file mode 100644 index 0000000..d277810 Binary files /dev/null and b/logger/target/debug/incremental/logger-2w2zycuzpvwx7/s-h1hrplsjau-14mpuqm-c96et3fouad2ikl5iboe17k1r/dep-graph.bin differ diff --git a/logger/target/debug/incremental/logger-2w2zycuzpvwx7/s-h1hrplsjau-14mpuqm-c96et3fouad2ikl5iboe17k1r/query-cache.bin b/logger/target/debug/incremental/logger-2w2zycuzpvwx7/s-h1hrplsjau-14mpuqm-c96et3fouad2ikl5iboe17k1r/query-cache.bin new file mode 100644 index 0000000..820c03b Binary files /dev/null and b/logger/target/debug/incremental/logger-2w2zycuzpvwx7/s-h1hrplsjau-14mpuqm-c96et3fouad2ikl5iboe17k1r/query-cache.bin differ diff --git a/logger/target/debug/incremental/logger-2w2zycuzpvwx7/s-h1hrplsjau-14mpuqm-c96et3fouad2ikl5iboe17k1r/work-products.bin b/logger/target/debug/incremental/logger-2w2zycuzpvwx7/s-h1hrplsjau-14mpuqm-c96et3fouad2ikl5iboe17k1r/work-products.bin new file mode 100644 index 0000000..19b7715 Binary files /dev/null and b/logger/target/debug/incremental/logger-2w2zycuzpvwx7/s-h1hrplsjau-14mpuqm-c96et3fouad2ikl5iboe17k1r/work-products.bin differ diff --git a/logger/target/debug/incremental/logger-2w2zycuzpvwx7/s-h1hrplsjau-14mpuqm.lock b/logger/target/debug/incremental/logger-2w2zycuzpvwx7/s-h1hrplsjau-14mpuqm.lock new file mode 100644 index 0000000..e69de29 diff --git a/logger/target/debug/incremental/logger-zkwgly2an98f/s-h1hrppfqal-15pr1ie-auynjir27fn2smpoaueeekwom/dep-graph.bin b/logger/target/debug/incremental/logger-zkwgly2an98f/s-h1hrppfqal-15pr1ie-auynjir27fn2smpoaueeekwom/dep-graph.bin new file mode 100644 index 0000000..a625a2a Binary files /dev/null and b/logger/target/debug/incremental/logger-zkwgly2an98f/s-h1hrppfqal-15pr1ie-auynjir27fn2smpoaueeekwom/dep-graph.bin differ diff --git a/logger/target/debug/incremental/logger-zkwgly2an98f/s-h1hrppfqal-15pr1ie-auynjir27fn2smpoaueeekwom/query-cache.bin b/logger/target/debug/incremental/logger-zkwgly2an98f/s-h1hrppfqal-15pr1ie-auynjir27fn2smpoaueeekwom/query-cache.bin new file mode 100644 index 0000000..4e64ef5 Binary files /dev/null and b/logger/target/debug/incremental/logger-zkwgly2an98f/s-h1hrppfqal-15pr1ie-auynjir27fn2smpoaueeekwom/query-cache.bin differ diff --git a/logger/target/debug/incremental/logger-zkwgly2an98f/s-h1hrppfqal-15pr1ie-auynjir27fn2smpoaueeekwom/work-products.bin b/logger/target/debug/incremental/logger-zkwgly2an98f/s-h1hrppfqal-15pr1ie-auynjir27fn2smpoaueeekwom/work-products.bin new file mode 100644 index 0000000..6d19b8d Binary files /dev/null and b/logger/target/debug/incremental/logger-zkwgly2an98f/s-h1hrppfqal-15pr1ie-auynjir27fn2smpoaueeekwom/work-products.bin differ diff --git a/logger/target/debug/incremental/logger-zkwgly2an98f/s-h1hrppfqal-15pr1ie.lock b/logger/target/debug/incremental/logger-zkwgly2an98f/s-h1hrppfqal-15pr1ie.lock new file mode 100644 index 0000000..e69de29 diff --git a/logger/target/debug/logger b/logger/target/debug/logger new file mode 100755 index 0000000..8c8c754 Binary files /dev/null and b/logger/target/debug/logger differ diff --git a/logger/target/debug/logger.d b/logger/target/debug/logger.d new file mode 100644 index 0000000..25433d6 --- /dev/null +++ b/logger/target/debug/logger.d @@ -0,0 +1 @@ +/home/caskd/Sources/Repositories/Personal/Rust/logger/target/debug/logger: /home/caskd/Sources/Repositories/Personal/Rust/logger/src/main.rs