Crates.io | flogging |
lib.rs | flogging |
version | 0.6.0 |
created_at | 2025-07-27 12:54:56.305067+00 |
updated_at | 2025-08-27 14:18:36.688753+00 |
description | This is a fast, flexible logging crate, loosely based on the Java logging package: java.util.logging. |
homepage | |
repository | https://github.com/bewillcott/flogging |
max_upload_size | |
id | 1770029 |
size | 222,278 |
<< Under Active Development >>
Flogging
provides an easy framework for logging.
Log entries can be sent to the console (stdout or stderr), file, memory log, or a custom handler. They can be formatted in various layouts: ISO8601, Simple, Unix TimeStamp, or a custom layout.
Macros and public methods are provided, with the macros being the simplest method of operation.
There are several levels for logging at:
There are even two special settings:
Version 0.6.0 BREAKS:
The output from Iso8601Formatter
. It has been changed 1.
The format string for fmt_string
has been changed from:
"{dt:35} |{mod_path}->{fn_name}| [{level:7}] {message}"
to:
"{dt:35} {mod_path}->{fn_name} [{level:7}] {message}"
In similar fashion, both SimpleFormatter
and UnixTimestampFormatter
have been changed 1.
Added new method to HandlerTrait
- set_test_mode()
. This will require updating any custom formatters you have created.
Note:
Version (0.6.0) is backwards compatible with version (0.5.0). Therefore it has the same warning. It is recommended that any use of version (0.4.X) be bumped to atleast (0.5.0), fixing the minor issue, as this will continue into all subsequent version updates.
Version 0.5.0 BREAKS the custom formatter API.
If you have not yet started developing your own versions of the formatter, then this will NOT affect you. The Public API is currently backwards compatible to version (0.4.1).
For the rest of you, please check out FormatType::Custom
and view the Change Log.
That's right. I realized that having just the API documentation was not going to be enough for you nerds out there, who just love to customize. So, I have written a guide. So far it covers the development of a custom handler and a custom formatter. There should be enough of an example of each to get you started.
At some point in the future, I might add more help/instructions. But at the moment I can't think of anything else to add. If you think of something that will help you and others, create an issue on Github.
This project is being developed as a learning experience. I am fully aware that there are many other logging crates out there, but where is the fun in that? As a hobbyist it still seems like a good idea.
A lot of the functionality has been inspired by, and even copied from (at the API level), the JDK's java.util.logging
package. Whether or not it will ever become a full port, only time and my level of interest, will tell. Remember, "learning experience"?
Flogging
, as-in, "Flogging a dead horse", or "Just another f*ing logger". As I wrote above, there are many other logging crates around. This is just my learning spin on a very well covered tool.
As per the requirements of the crate site (https://crates.io/), I am using Semantic Versioning in accordance with the specifications documented on this site: https://semver.org/.
Therefore, once I am certain that the API is stable, I'll release v1.0.0.
I have included the latest test coverage report, generated by llvm-cov
and llvm-cov-pretty
.
It is located here: coverage report.
See RELEASELOG.md and CHANGELOG.md
Having said all that, with jokes aside, this is a fully working project. One that I hope others will benefit from. If not just using it, then perhaps learning from the source code displaying the various solutions to the problems involved in providing the functionality.
Anyway, have fun.
Bradley Willcott
mailto:bw.opensource@yahoo.com