Four error classes exist in the code: info, warn, error and fatal. The fatal error class can not be hidden, and when this fatal error occurs the program is terminate. For all other errors, the configuration file can be used to define whether the printing is allowed or forbidden on a per-file basis.
For this approach to work, the .cc file must include the following two lines:
#include "MNMsg.h"
MNMSG_USE("</tt>the_filename<tt>")
In the code, the macros MN_INFO, MN_WARN, MN_ERROR and MN_FATAL can then be used. The parameter of the macro is passed through ostream objects, and all formatting operations are allowed. To control which messages are printed, the section is used like this:
<system> <debug> <no-info-print /> <no-warn-print /> <error-print /> <info-do> <file value="MNSelector" /> <file value="MNThread" /> </info-do> <warn-do> <file value="MNSelector" /> </warn-do> <error-do /> <info-dont /> <warn-dont /> <error-dont> <file value="MNSelector" /> </error-dont> </debug> </system>
The individual value are used as follows:
<info-print>
is a boolean value that controls whether informative messages are generally printed or not. The default is true.<info-do>
is a string list value that overrides an <info-print>
value that is false for individual files. If the value of <info-print>
is true, this value is ignored.<info-dont>
is a string list value that overrides an <info-print>
value that is true for individual files. If the value of <info-print>
is false, this value is ignored.<warn-print>
is a boolean value that controls whether warning messages are generally printed or not. The default is true.<warn-do>
works for <warn-print>
as <info-do>
does for <info-print>
.<warn-dont>
works for <warn-print>
as <info-dont>
does for <info-print>
.<error-print>
is a boolean value that controls whether error messages are generally printed or not. The default is true.<error-do>
works for <error-print>
as <info-do>
does for <info-print>
.<error-dont>
works for <error-print>
as <info-dont>
does for <info-print>
.