Changes between Version 2 and Version 3 of SrlApi


Ignore:
Timestamp:
Feb 1, 2007, 2:40:36 AM (17 years ago)
Author:
Nicolas Pouillon
Comment:

Log levels

Legend:

Unmodified
Added
Removed
Modified
  • SrlApi

    v2 v3  
    77Log API let you define message levels. Levels allow you to let your debug code in the source, and only compile it when needed.
    88
     9In order, levels are:
     10 * NONE
     11 * TRACE
     12 * DEBUG
     13 * MAX
     14
     15When writing your software, you decide what level the message is for. When compiling or running you software, you decide what minimal level your code must have to be printed.
     16
    917 * {{{srl_log(level, "message")}}} prints a message
    1018 * {{{srl_log_printf(level, "message_with_format", arguments...)}}} prints a printf-like message
     19
     20Arguments in printf-like version may be not evaluated if level is not sufficient. Therefore you '''MUST NOT''' put expressions with side effects in the parameter list. ie do '''not''' do this:
     21{{{
     22srl_log_printf(DEBUG, "i=%d\n", i++);
     23}}}
    1124
    1225== Mwmr fifos ==