{"id":16860653,"url":"https://github.com/qarmin/handsome_logger","last_synced_at":"2025-04-11T08:35:10.422Z","repository":{"id":177929253,"uuid":"658670253","full_name":"qarmin/handsome_logger","owner":"qarmin","description":"Simple terminal/file logger with multiple features","archived":false,"fork":false,"pushed_at":"2025-03-11T19:32:37.000Z","size":109,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T06:06:08.517Z","etag":null,"topics":["logger","logging"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qarmin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.APACHE2","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-26T09:01:54.000Z","updated_at":"2025-03-11T19:32:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ddeaab5-c8bf-4284-a2c8-13c187124303","html_url":"https://github.com/qarmin/handsome_logger","commit_stats":null,"previous_names":["qarmin/handsome_logger"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qarmin%2Fhandsome_logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qarmin%2Fhandsome_logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qarmin%2Fhandsome_logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qarmin%2Fhandsome_logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qarmin","download_url":"https://codeload.github.com/qarmin/handsome_logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248361741,"owners_count":21090977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logger","logging"],"created_at":"2024-10-13T14:25:54.975Z","updated_at":"2025-04-11T08:35:10.405Z","avatar_url":"https://github.com/qarmin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Handsome Logger\n\nHandsome logger aims to be fast, easy to use and configurable logger.\n\nThis is a fork of [simplelog.rs](https://github.com/Drakulix/simplelog.rs) from commit\n`70f4dcb6c20de819b68a4c52988e850403f779db` and is available under same license as the original project.\n\nI created it because the formatting abilities of this library were insufficient for me and the changes that would have\nto be made to it to \"fix\" it were too big.\n\n![Example](https://github.com/qarmin/handsome_logger/assets/41945903/f409c771-abb5-47dd-acfe-0aa385475591)\n\n## Features\n\n- Multiple loggers - SimpleLogger(simplest and the stablest), TermLogger(SimpleLogger + colored output), WriteLogger(can\n  save logs e.g. to file), CombinedLogger(can combine multiple loggers and save logs, both to file and to terminal)\n- Uses by default local time offset instead of UTC - this can be easily disabled\n- Customizable format - each element, like timestamp or module name, log level, can be customized\n- Colored output - you can colorize any part of log message\n- Simple to use - library can be easily configured in few lines of code for most use cases\n- Ability to set log level by environment variable e.g. `RUST_LOG=error ./app`\n- Filtering messages - you can ignore any message basing on your own function\n- Multiple log message formatters(you can use them more than once - nobody can stop you):\n\n```\n[_line] - prints line of code where log was called or 0 if cannot read line\n[_file] - prints full project path to file where log was called if is inside repository of full path if is outside, or \"\u003cunknown\u003e\" if cannot read file path\n[_file_name] - prints file name where log was called or \"\u003cunknown\u003e\" if cannot read file name\n[_module] - prints module name where log was called or \"\u003cunknown\u003e\" if cannot read module name\n[_msg] - prints user log message\n[_time] - prints time of logged message\n[_level] - prints log level (INFO, DEBUG, etc.)\n[_thread_id] - prints thread id\n[_thread_name] - prints thread name\n[_process_id] - prints process id\n[_color_start], [_color_end] - starts and ends colorization of log message\n```\n\n## Example Usage\n\nFirst add to Cargo.toml, this two lines\n\n```\nhandsome_logger = \"0.9\"\nlog = \"0.4\"\n```\n\n```rust\nuse handsome_logger::{ColorChoice, Config, TermLogger, TerminalMode};\nuse log::*;\n\nfn main() {\n    handsome_logger::init().unwrap();\n    // which is simpler alternative to\n    // TermLogger::init(Config::default(), TerminalMode::Mixed, ColorChoice::Auto).unwrap();\n\n    trace!(\"Got TRACE\");\n    debug!(\"Got DEBUG\");\n    info!(\"Got INFO\");\n    warn!(\"Got WARNING\");\n    error!(\"Got ERROR\");\n}\n```\n\nshould print\n\n```\n21:20:22 [INFO] terminal_logging: Got INFO\n21:20:22 [WARN] terminal_logging: Got WARNING\n21:20:22 [ERROR] terminal_logging: Got ERROR\n```\n\nexamples folder contains examples of\n\n- formatting logs\n- saving logs to file and rotating it\n- using multiple loggers\n- colouring terminal output\n- filtering messages\n\n## License\n\nApache 2.0 or MIT, at your option.\n\nCopyright (c) 2023-2025 Rafał Mikrut  \nCopyright (c) 2015-2023 Victor Brekenfeld and contributors(for full list\nsee https://github.com/Drakulix/simplelog.rs/graphs/contributors)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqarmin%2Fhandsome_logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqarmin%2Fhandsome_logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqarmin%2Fhandsome_logger/lists"}