1
1
Fork
You've already forked ecformat
0

Add different log levels #20

Manually merged
BaumiCoder merged 8 commits from feature/18-log-levels into main 2025年09月01日 14:54:16 +02:00

Resolves #18

User perspective

The command line options -v / --verbose allows increasing the log level and -q / --quiet to decrease it (See also clap_verbosity_flag documentation).

Developer perspective

Logging with the standard log crate with a simple logger which writes to stderr or stdout depending on the log level. This PR adds no tests because it is only a general configuration change and a switch from println! to info! for the output, which is not relevant for testing.

Resolves #18 ### User perspective The command line options `-v` / `--verbose` allows increasing the log level and `-q` / `--quiet` to decrease it (See also [clap_verbosity_flag documentation](https://docs.rs/clap-verbosity-flag/3.0.4/clap_verbosity_flag/index.html#using---verbose-and---quiet-flags)). ### Developer perspective Logging with the standard [log crate](https://crates.io/crates/log) with a [simple logger](https://crates.io/crates/simplelog) which writes to `stderr` or `stdout` depending on the log level. This PR adds no tests because it is only a general configuration change and a switch from `println!` to `info!` for the output, which is not relevant for testing.
Using the ? operator inside the info macro lead to the problem
that the Error is logged as info and not return by the function.
At the outer most level to allow handling of errors
when used as library crate.
No necessary in lib part of the crate and setting the logger
should not be inside the lib, as the user of the lib crate should be
able to set its own logger.
Errors should be written to stderr and the other log levels to stdout.
env_logger does not support this.
BaumiCoder manually merged commit ba1618f622 into main 2025年09月01日 14:54:16 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
Compat/Breaking
Breaking change that won't be backward compatible
EditorConfig
0.17.2
Issues to support version 0.17.2 of the EditorConfig specification
Kind
Bug
Something is not working
Kind
Chore
Some tasks maintainig tasks
Kind
Documentation
Documentation changes
Kind
Enhancement
Improve existing functionality
Kind
Feature
New functionality
Kind
Testing
Issue or pull request related to testing
Packaging
About packaging the project for some platform
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
WIP
Work in progress (Assignee is working on this issue)
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BaumiCoder/ecformat!20
Reference in a new issue
BaumiCoder/ecformat
No description provided.
Delete branch "feature/18-log-levels"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?