[syslinux] unify core printf()/dprintf(): thoughts?

Raphael S Carvalho raphael.scarv at gmail.com
Sun Sep 15 19:41:25 PDT 2013


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.


More information about the Syslinux mailing list