Skip to content

LilCloudCoder/RustCode_Logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code_Logger

A simple, colorful, and flexible logging library for Rust with support for timestamps, log levels, and custom error codes. Built using a builder pattern for ergonomic usage.

Crates.io Rust


Features

  • Four log levels: Info, Warn, Error, Debug
  • Optional timestamps
  • Optional custom error codes
  • Color-coded output in the terminal
  • Ergonomic builder pattern

Installation

Add code_logger to your Cargo.toml:

[dependencies]
code_logger = "..."

Usage:

fn main() {
    // Using builder
    log("Hello, world!".to_string())
        .timestamp()
        .code(42)
        .info()   // builds the Logger
        .print(); // actually prints it

    // Or directly
    let logger = log("Something went wrong".to_string())
        .code(404)
        .error(); // builds Logger

    logger.print(); // prints it
}

About

Code_logger for rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages