#log-messages #logging #terminal #debugging #message #warnings #print

piglog

一种简单而美观地在终端打印日志消息的方法

8 个稳定版本

1.4.1 2023 年 12 月 24 日
1.3.2 2023 年 12 月 24 日
1.3.1 2023 年 11 月 5 日
1.3.0 2023 年 10 月 31 日

#10 in #warnings

Download history 30/week @ 2024-03-11 2/week @ 2024-03-18 1/week @ 2024-03-25 35/week @ 2024-04-01 6/week @ 2024-04-08 4/week @ 2024-04-29 3/week @ 2024-05-06 6/week @ 2024-05-13 32/week @ 2024-05-20 24/week @ 2024-05-27 22/week @ 2024-06-03 22/week @ 2024-06-10 23/week @ 2024-06-17 26/week @ 2024-06-24

102 个月下载量
用于 6 crates

MIT 许可证

28KB
130 代码行数(不包括注释)

PigLog

一种简单而美观地在终端打印内容的方法。

示例

use piglog::prelude::*;

fn main() {
  piglog::success!("Hello, world!"); // Something successfully did something!
  piglog::info!("Hello, world!"); // General information.
  piglog::warning!("Hello, world!"); // A warning.
  piglog::error!("Hello, world!"); // Something errored out, but the program can still run.
  piglog::fatal!("Hello, world!"); // Something errored out so bad, the program has to stop!
  piglog::note!("Hello, world!"); // Additional information, kind of like a hint.
  piglog::task!("Hello, world!"); // About something that the programmer has to implement.
  piglog::generic!("Hello, world!"); // A sub log message, basically, a way to continue another log message.

  piglog::piglog_config::enable_debug_log(); // Debug messages don't show up unless this function is called.

  piglog::debug!("Hello, world!"); // Debug log. (Extra log messages for nerds. Lol!)
}

依赖项

~0–10MB
~57K SLoC