simon-fu / mp4v2

Automatically exported from code.google.com/p/mp4v2
Other
0 stars 0 forks source link

new Log class / callback #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To provide apps a way to get log information instead of sending it to
stdout via the VERBOSE_* macros, create a Log class that supports the
following levels:

enum MP4LogLevel {
    MP4LogError = 1,
    MP4LogWarning = 2,
    MP4LogInfo = 3,
    MP4LogVerbose1 = 4,
    MP4LogVerbose2 = 5,
    MP4LogVerbose3 = 6,
    MP4LogVerbose4 = 7
}

A new API function MP4SetLogCallback allows users to set the callback
function, which has signature something like

typedef void (*log_message_cb_func_t)(
    MP4LogLevel loglevel,
    const char* fmt,
    ... );

-DB

Original issue reported on code.google.com by dbyr...@gmail.com on 2 Feb 2009 at 9:56

GoogleCodeExporter commented 9 years ago
Here's my initial implementation of the Log class, along with 
MP4SetLogCallback. 
Slightly different than the above.  Here's the current enum and callback 
signature:

typedef enum {
    MP4LogNone = 0,
    MP4LogError = 1,
    MP4LogWarning = 2,
    MP4LogInfo = 3,
    MP4LogVerbose1 = 4,
    MP4LogVerbose2 = 5,
    MP4LogVerbose3 = 6,
    MP4LogVerbose4 = 7
}  MP4LogLevel;

typedef void (*log_message_cb_func_t)(
    MP4LogLevel loglevel,
    const char* fmt,
    va_list     ap );

-DB

Original comment by dbyr...@gmail.com on 5 Feb 2009 at 9:04

Attachments:

GoogleCodeExporter commented 9 years ago
One line change in the path to export MP4SetLogCallback.  Still messing with 
some
build settings...

-DB

Original comment by dbyr...@gmail.com on 6 Feb 2009 at 2:02

Attachments:

GoogleCodeExporter commented 9 years ago
- remove const from Log::printf, etc.
- log_message_cb_func_t --> MP4LogCallback
- add release notes announcing new function MP4SetLogCallback
- used C++-style comments in log.cpp

-DB

Original comment by dbyr...@gmail.com on 10 Feb 2009 at 2:45

Attachments:

GoogleCodeExporter commented 9 years ago
Committed to https://mp4v2.googlecode.com/svn/branches/logging.  See that 
branch for
more progress here.

Original comment by dbyr...@gmail.com on 13 Feb 2009 at 9:08

GoogleCodeExporter commented 9 years ago
Closing this since these changes (or similar ones) have made it into trunk.

Original comment by dbyr...@gmail.com on 27 Mar 2011 at 2:31