Remove main file and add direnv configuration

This commit is contained in:
2026-08-20 17:54:18 -05:00
parent 9f0ac3810d
commit 511b1dfbe4
22 changed files with 559 additions and 3 deletions
+30
View File
@@ -0,0 +1,30 @@
// src/lib.rs
//! Console logging utilities for Rust applications.
use log::{Level, LevelFilter, Metadata, Record, SetLoggerError};
/// A minimal console logger implementation.
pub struct ConsoleLogger;
static LOGGER: ConsoleLogger = ConsoleLogger;
impl log::Log for ConsoleLogger {
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) {}
}
/// Initializes the console logger with `Info` as the maximum log level.
pub fn init() -> Result<(), SetLoggerError> {
log::set_logger(&LOGGER)?;
log::set_max_level(LevelFilter::Info);
Ok(())
}
-3
View File
@@ -1,3 +0,0 @@
fn main() {
println!("Hello, world!");
}