Raphael S Carvalho
2013-Sep-16 02:41 UTC
[syslinux] unify core printf()/dprintf(): thoughts?
Genec, your approach is also very insteresting, but I would like to present an alternative which will basically works with three priority states. ALTERNATIVE APPROACH: FILTER AND PRIORITIES ON PRINT. ----- Detail: Lower the priority number higher the importance of the message. ----- - default priority level: * Messages without a prefix will *always* take this priority level. ----- - debug priority level: * Messages with priority *lower than* the debug priority level will *only* go to the filter stage. * Messages with priority *equal than* the debug priority level will go to the filter stage and the current console. * Messages with priority *higher than* the debug priority level will *only* go to the current console. ----- *** FILTER STAGE (Used to filter which messages will go over the serial port) *** - filter priority level: * Filter priority level will be used to determine which messages should go over the serial port. * Messages with priority level *lower or equal than* the filter priority level will go over the serial port. * Messages with priority level *higher than* the filter priority level and *lower than* the debug priority level will be lost. ----- Example: // These numbers should be initialized statically, but options should be given to change // them dynamically. default priority level = 5 debug priority level = 3 filter priority level = 1 // Higher than the debug priority level, then go *only* to the current console. print("<4>foo"); // Equal than the debug priority level, then go to the filter stage and the current console. // Filter stage: Higher than the filter priority level, then this message will be lost. print("<3>foo"); // Lower than the debug priority level, then go *only* to the filter stage. // Filter stage: Equal than the filter priority level, then go over the serial port. print("<1>foo"); // Message without a prefix will take the default priority level, then its priority level is 5. print("foo"); Regards, Raphael S. Carvalho.
On Sun, 15 Sep, at 11:41:25PM, Raphael S Carvalho wrote:> Genec, your approach is also very insteresting, but I would like to > present an alternative which will basically works with three priority > states. > > ALTERNATIVE APPROACH: FILTER AND PRIORITIES ON PRINT. > ----- > Detail: Lower the priority number higher the importance of the message.Yeah, I quite like this approach because you're using a priority number to describe the importance of the message, rather than to describe where the message be printed to. -- Matt Fleming, Intel Open Source Technology Center
Apparently Analagous Threads
- unify core printf()/dprintf(): thoughts?
- [RFC/PATCH 2/3] core: MultiFS infrastructure added.
- [PATCH 001/001] core/serial: Add support for serial output functions.
- Use z size specifier for printf-ing size_t variable
- [PATCH v2] core: Check size of ldlinux.sys at building time.