{"id":20481287,"url":"https://github.com/0xricksanchez/hackerlog","last_synced_at":"2025-04-13T14:11:09.886Z","repository":{"id":189671010,"uuid":"681087867","full_name":"0xricksanchez/hackerlog","owner":"0xricksanchez","description":"A simple but lightweight logging library with no fluff ","archived":false,"fork":false,"pushed_at":"2025-02-06T07:16:28.000Z","size":28,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T23:08:25.707Z","etag":null,"topics":["logger","logging","logging-library"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/hackerlog","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xricksanchez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-21T08:33:07.000Z","updated_at":"2025-02-06T07:15:56.000Z","dependencies_parsed_at":"2023-08-21T08:54:16.000Z","dependency_job_id":null,"html_url":"https://github.com/0xricksanchez/hackerlog","commit_stats":null,"previous_names":["0xricksanchez/hackerlog"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xricksanchez%2Fhackerlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xricksanchez%2Fhackerlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xricksanchez%2Fhackerlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xricksanchez%2Fhackerlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xricksanchez","download_url":"https://codeload.github.com/0xricksanchez/hackerlog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724629,"owners_count":21151561,"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","logging-library"],"created_at":"2024-11-15T16:07:38.696Z","updated_at":"2025-04-13T14:11:09.874Z","avatar_url":"https://github.com/0xricksanchez.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hackerlog\n\nA super simple but lightweight logging library that tries to capture the most important\n(status) information. The following is supported:\n\n- [x] Log level with colors\n- [x] Verbose mode:\n  - [x] Timestamp\n  - [x] PID\n  - [x] Thread name\n  - [x] Location\n- [x] Output redirection to a log\n- [x] Custom formatting\n- [x] Structured logging\n- [x] Log-level filtering\n- [x] Custom contexts\n\n## Examples\n\nThe core functionality can be seen in the `examples/` folder.\nYou can run both of them via `cargo run --example \u003cname\u003e`:\n\n### Simple logger\n\n```bash\n``cargo run --example simple\n   Compiling hackerlog v0.1.4 (/home/krah/git/priv/hackerlog)\n    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.13s\n     Running `target/debug/examples/simple`\n[\u003e] This is an info message\n[\u003e] This is an info message with a variable: 1337\n[\u003e] This is an info message with different syntactic sugar: 1337\n[!] This is a warning message\n[x] This is an error message\n[+] This is a success message\n[-] This is a failure message\n```\n\n### Verbose logger\n\n```bash\ncargo run --example verbose\n   Compiling hackerlog v0.1.0 (/Users/0x434b/Git/private/hackerlog)\n    Finished dev [unoptimized + debuginfo] target(s) in 0.22s\n     Running `target/debug/examples/verbose`\n[\u003e] (11:48:52) - [PID: 15435 | Thread: main] - (examples/verbose.rs:4) : This is an info message\n[#] (11:48:52) - [PID: 15435 | Thread: main] - (examples/verbose.rs:5) : This is a debug message\n[!] (11:48:52) - [PID: 15435 | Thread: main] - (examples/verbose.rs:6) : This is a warning message\n[x] (11:48:52) - [PID: 15435 | Thread: main] - (examples/verbose.rs:7) : This is an error message\n[+] (11:48:52) - [PID: 15435 | Thread: main] - (examples/verbose.rs:8) : This is a success message\n[-] (11:48:52) - [PID: 15435 | Thread: main] - (examples/verbose.rs:9) : This is a failure message\n```\n\n### Structured logger\n\nOr for a more complex logging format:\n\n```\n cargo run --example structured --features structured\n   Compiling hackerlog v0.1.4 (/home/krah/git/priv/hackerlog)\n    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.18s\n     Running `target/debug/examples/structured`\n2025-02-06 11:01:15 INFO User logged in [ip=\"192.168.1.1\", success=true, user_id=1234]\n2025-02-06 11:01:15 INFO User details [login_count=5, session_id=\"abc-123\", user={\"id\":1234,\"name\":\"alice\",\"role\":\"admin\"}]\n2025-02-06 11:01:15 DEBUG Operation timing [duration_human=\"100.31ms\", duration_ms=100, operation=\"database_query\"]\n2025-02-06 11:01:16 INFO Operation timing [duration_human=\"100.30ms\", duration_ms=100, operation=\"api_request\"]\n2025-02-06 11:01:16 WARN Operation timing [duration_human=\"100.07ms\", duration_ms=100, operation=\"critical_operation\"]\n2025-02-06 11:01:16 INFO Thread finished [status=\"complete\", thread_id=1]\n2025-02-06 11:01:16 INFO Operation timing [duration_human=\"100.46ms\", duration_ms=100, operation=\"thread_operation_1\"]\n2025-02-06 11:01:16 INFO Thread finished [status=\"complete\", thread_id=2]\n2025-02-06 11:01:16 INFO Operation timing [duration_human=\"100.50ms\", duration_ms=100, operation=\"thread_operation_2\"]\n2025-02-06 11:01:16 INFO Thread finished [status=\"complete\", thread_id=0]\n2025-02-06 11:01:16 INFO Operation timing [duration_human=\"100.59ms\", duration_ms=100, operation=\"thread_operation_0\"]\n```\n\n## Usage\n\nRun `cargo add hackerlog` in your project root and just import `hackerlog` in your application as `use hackerlog::*;` and you have access to the macros:\n\n- info!\n- debug!\n- warn!\n- err!\n- success!\n- fail!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xricksanchez%2Fhackerlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xricksanchez%2Fhackerlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xricksanchez%2Fhackerlog/lists"}