API for debug logs
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 1.3k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 7
Description
I noticed that LMMS does not have a convenient mechanism for debug messages, printfs are used instead.
My proposal is to create a flexible, yet easy to use mechanism:
- The developer would use dedicated macros named, let's say, Log_Fatal, Log_Error, Log_Warn, Log_Info, Log_Dbg, Log_Dbg_Super - listed here in ascending level of verbosity
- The functions above would accept the same syntax as printf function, since they would actually encapsulate (sn|f)printfs.
- The tracing mechanism would forward appropriate mechanism to a few sinks. Two kinds of those come to my mind right now: console output and log file output.
- Each sink would be assigned a level of verbosity. Let's say, by default the console would be filled up with fatal errors, errors and warnings, while the logfile would include info and normal debug messages as well. This way the console will not be spammed with uninteresting messages, still preserving more detailed information in the log file.
- The default tracing levels would be modifiable via command line arguments, as such:
They also could be configured in the main configuration window.$ ./lmms --log-console=info, --log-file=dbg-super - Each log line, besides the log message, would include the information about its severity, the timestamp, name of the source file and number of the line, like this:
I-190901-12:34:56.789012-vestige.cpp:123: Program change to 42
Use of log severity indicator {F, E, W, I, D, S} would allow a quick look-up for the messages in the log using vim, for example "G, ?^E" would jump to the last error message.
- The console output would use the ANSI escape sequences to color the messages
Contributor guide
No contributing guide indexed for this repository
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 locating the existing printf-based debug output and the command-line and main configuration handling in LMMS. Review how those areas could support severity levels, console and file sinks, timestamps, source locations, and ANSI coloring. Done means the proposed logging API and configuration behavior are implemented across the requested outputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100