Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for debug logs #5159

Closed
artur-twardowski opened this issue Aug 29, 2019 · 2 comments
Closed

API for debug logs #5159

artur-twardowski opened this issue Aug 29, 2019 · 2 comments

Comments

@artur-twardowski
Copy link
Contributor

artur-twardowski commented Aug 29, 2019

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:
    $ ./lmms --log-console=info, --log-file=dbg-super
    
    They also could be configured in the main configuration window.
  • 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
@PhysSong
Copy link
Member

Possible duplicate of #3876.

@PhysSong PhysSong mentioned this issue Apr 26, 2020
3 tasks
@PhysSong
Copy link
Member

Consolidated into #5468.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants