{"id":22199944,"url":"https://github.com/durydevelop/rust-lib-durylog","last_synced_at":"2025-03-24T23:46:03.245Z","repository":{"id":65345139,"uuid":"588550181","full_name":"durydevelop/rust-lib-durylog","owner":"durydevelop","description":"An easy to use and lightweight library to implements logging on stdout, file or both.","archived":false,"fork":false,"pushed_at":"2023-01-20T08:56:49.000Z","size":28781,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T02:44:16.686Z","etag":null,"topics":["debug","logger","logging","rust","rust-crate"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/durydevelop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-13T11:51:40.000Z","updated_at":"2023-01-17T17:23:17.000Z","dependencies_parsed_at":"2023-02-12T01:01:32.190Z","dependency_job_id":null,"html_url":"https://github.com/durydevelop/rust-lib-durylog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durydevelop%2Frust-lib-durylog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durydevelop%2Frust-lib-durylog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durydevelop%2Frust-lib-durylog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durydevelop%2Frust-lib-durylog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/durydevelop","download_url":"https://codeload.github.com/durydevelop/rust-lib-durylog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245372221,"owners_count":20604489,"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":["debug","logger","logging","rust","rust-crate"],"created_at":"2024-12-02T15:19:15.750Z","updated_at":"2025-03-24T23:46:03.218Z","avatar_url":"https://github.com/durydevelop.png","language":"Rust","readme":" # durylog\n \n This crate adds logging to your projects or library.\n \n After trying a lot of crates to make logging, I only found crates rich of futures but very complicate to use,\n or crates that are easy to use but log only on file or only on console.\n \n I decided to write my own lib that aims to be **easy to use with some usefull futures**:\n * Can log only on stdout, only on file or both.\n * Very easy to start: install and use immediately.\n * Short API names.\n * It implements [log](https://crates.io/crates/log) crate so you can use Rust library logging macros.\n \n ## Add to project:\n In file cargo.toml add:\n ```toml\n [dependencies]\n durylog = \"0.1.0\"\n ```\n ## Getting Start\n There are 2 way for use this crate:\n * Directly create object: ```let durylog=DLog::new();``` and use like ```durylog.d(\"Log message\");```\n * Initialize logger: ```DLog::new().init_logger().ok();``` and use with [log](https://crates.io/crates/log) macro like ```debug!(\"Log message\");```\n\n Read [documentation](https://docs.rs/durylog/) and [examples](examples/).\n \n Output (on console and/or file) for default settings is like:\n ```\n 2023/01/02 18.01.27 : DEBUG  : Debug message\n ```\n First tag is datetime stamp, second tag is level name followed by log message tag\n  ## Examples:\n ### Directly usage with default settings:\n ```rust\n use durylog::DLog;\n \n fn main() {\n     let durylog=DLog::new();\n \n     println!(\"{}\", durylog.get_status()); // This prints all current crate settings (in this case are defaults)\n \n     durylog.e(\"Error message\");\n     durylog.w(\"Warning message\");\n     durylog.i(\"Info message\");\n     durylog.d(\"Debug message\");\n     durylog.t(\"Trace message\");\n }\n ```\n This will log on stdout without colors.\n \n ### Directly usage with custom settings:\n ```rust\n use durylog::DLog;\n \n fn main() {\n     let durylog=DLog::new()\n     .with_color() // Enable colors in console output (default disabled)\n     .widh_timestamp_format(\"%Y-%m-%d %H:%M:%S\") // Change default timestamp\n     .widh_custom_separator(\" | \") // Change default separator pattern for items\n     .with_file(\"durylog-custom.log\").unwrap(); // Enable logging on file (default disable)\n \n println!(\"{}\", durylog.get_status()); // This prints all current crate settings (in this case there are custom)\n \n     durylog.e(\"Error message\");\n     durylog.w(\"Warning message\");\n     durlog.i(\"Info message\");\n     durylog.d(\"Debug message\");\n     durylog.t(\"Trace message\");\n }\n ```\n This will log on stdout with colors, different formatting for timestamp and different tags separator and in file durylog-custom.log are added same log lines as in console.\n \n ### Macros usage with default settings:\n ```rust\n use durylog::{error,warn,info,debug,trace,DLog};\n \n fn main() {\n     DLog::new().init_logger().ok();\n \n     error!(\"Error message\");\n     warn!(\"Warning message\");\n     info!(\"Info message\");\n     debug!(\"Debug message\");\n     trace!(\"Trace message\");\n }\n ```\n This will log on stdout without colors.\n \n ### Macros usage with custom settings:\n ```rust\n use durylog::{error,warn,info,debug,trace,DLog};\n \n fn main() {\n     DLog::new()\n         .with_color() // Enable colors in console output (default disabled)\n         .widh_timestamp_format(\"%Y-%m-%d %H:%M:%S\") // Change default timestamp\n         .widh_custom_separator(\" | \") // Change default separator pattern for items\n         .with_file(\"log-custom.log\").unwrap() // Enable logging on file (default disable)\n         .init_logger().ok();\n \n     error!(\"Error message\");\n     warn!(\"Warning message\");\n     info!(\"Info message\");\n     debug!(\"Debug message\");\n     trace!(\"Trace message\");\n }\n ```\n This will log on stdout with colors, different formatting for timestamp and different tags separator and in file log-custom.log are added same log lines as in console.\n ","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurydevelop%2Frust-lib-durylog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdurydevelop%2Frust-lib-durylog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurydevelop%2Frust-lib-durylog/lists"}