On Sat, May 20, 2017 at 7:57 AM, Anton Khirnov <[email protected]> wrote: > The default logging callback in lavu currently contains several > "advanced" features, such as > - suppressing repeated messages > - automatically hiding the log prefix > - color support > They add significant complexity to the logging callback and - more > importantly - global state, making logging not thread-safe (and strictly > speaking introducing UB). > > Many (perhaps most) of our callers either do not care for such fancy > features, or already use a custom logging callback. Therefore, it is > better to move them to cmdutils (for use by avtools) and leave the > default logging callback simple, straightforward and safe. > ---
Would it be possible to move the new log code to a separate file than cmdutils? It would prevent polluting the file with highly specific log functions. > One thing for discussion is the logging prefix (the [mp3 @ 0xdeadface] > thingy). > The current code checks whether the message contains a newline, and when it > doesn't it toggles a flag to skip the prefix on the next invocation. Since we > don't want such global flags, I see two possibilities: > * just abolish the prefices (what I did) > * print them always > Comments/other suggestions welcome. > --- I'd print it always, but introduce a set of functions that allow you print to a buffer and then use av_log to print it with a sutffix as normal. -- Vittorio _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
