Git Product home page Git Product logo

hackerlog's Introduction

Hackerlog

A super simple but lightweight logging library that tries to capture the most important (status) information. The following is supported:

  • Log level with colors
  • verbose mode:
    • Timestamp
    • PID
    • Thread name
    • Location

Examples

The core functionality can be seen in the examples/ folder. You can run both of them via:

cargo run --example simply # or
cargo run --example verbose # or
cargo run --example threads

For example:

cargo run --example verbose
   Compiling hackerlog v0.1.0 (/Users/0x434b/Git/private/hackerlog)
    Finished dev [unoptimized + debuginfo] target(s) in 0.22s
     Running `target/debug/examples/verbose`
[>] (11:48:52) - [PID: 15435 | Thread: main] - (examples/verbose.rs:4) : This is an info message
[#] (11:48:52) - [PID: 15435 | Thread: main] - (examples/verbose.rs:5) : This is a debug message
[!] (11:48:52) - [PID: 15435 | Thread: main] - (examples/verbose.rs:6) : This is a warning message
[x] (11:48:52) - [PID: 15435 | Thread: main] - (examples/verbose.rs:7) : This is an error message
[+] (11:48:52) - [PID: 15435 | Thread: main] - (examples/verbose.rs:8) : This is a success message
[-] (11:48:52) - [PID: 15435 | Thread: main] - (examples/verbose.rs:9) : This is a failure message

Usage

Run cargo add hackerlog in your project root and just import hackerlog in your application as use hackerlog::*; and you have access to the macros:

  • log_info!
  • log_debug!
  • log_warn!
  • log_err!
  • log_success!
  • log_fail!

hackerlog's People

Contributors

0xricksanchez avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.