Add a log_print() function
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 13.6k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Something like:
log_print(int verbosity, bool main_only, char *format, ...)
Goals: Any code that now prints to stderr and/or log with a bunch of conditions (with 3-10 lines of code each time) could be replaced with a single call to a shared function in logger.c with following options:
- Send to screen, or log, or both.
- Line-wrap at word boundary (at whatever we deem to be the output width).
- Only print to parent process, or any/all. Only print node number when applicable.
- Optionally colorize serious notes (eg. yellow) and warnings (eg. red).
- Minimum verbosity for sending to screen and a separate minimum "log level" for sending to log. BTW I think I want specific future options like
--log-no-rule-detailsand--log-no-mode-detailswhile--log-nonewould deprecate the current-nolog. Perhaps this should be considered.
I have initial code for this, but it really needs some thought to end up really good.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing logger.c and the existing code that prints to stderr and/or the log with conditional logic. Compare those call sites with the proposed verbosity, output-target, wrapping, process, node, color, and log-level options; done means the shared interface and its scope are settled and the relevant call sites can use it consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100