Opened 18 years ago
Closed 18 years ago
#2130 closed defect (wontfix)
VERBOSE() macro for C files
Reported by: | Owned by: | GoToDev | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
Looking through the log files, I see a bunch of entries that don't begin with timestamps. From the code, I found that this is because the timestamps are added by the VERBOSE macro, and that is only defined for C++. In C, logging is done unconditionally with printf().
Once this is defined for C, it should be a rather simple matter to change the printf statements to VERBOSE.
There are two obvious approaches to use:
1) Write a C++ function that can be called from C. 2) Define a separate C version of the macro.
I'm attaching a patch that takes approach 2. It works, but it duplicates the code for the flags from mythcontext.h. The right way of doing it would be to split mythcontext.h into two include files, separating the C++ aspects from the logging definitions. A simple way of doing that would be to #inlcude my new logging.h in mythcontext.h (and then undef VERBOSE before putting in the C++ version). Or preprocessor defines could be used to separate out the code that is specific to C or C++.
I'm also clueless as to the right directory for logging.h, or the issues regarding which library to include verbose_from_c() into for approach 1.
Attachments (1)
Change History (2)
Changed 18 years ago by
Attachment: | myth-logging.patch added |
---|
comment:1 Changed 18 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
External code in libav* should be using the av_log api, which we can wrap in the code that calls ffmpeg functions. We don't want to be changing their code to use myth-specific logging stuff.