verboseMsg.h File Reference

Verbose message handling. More...

#include <stdio.h>
#include <glib.h>

Go to the source code of this file.

Defines

Available verboseLevel
Predefined verbose levels.

You can define more levels by yourself if necessary.

#define VERBOSE_MSG_NONE   -1
 No debug message output.
#define VERBOSE_MSG_CRITICAL   0
 Output critical messages.
#define VERBOSE_MSG_ERROR   1
 Output general errors and above.
#define VERBOSE_MSG_WARNING   2
 Output warning messages and above.
#define VERBOSE_MSG_INFO1   3
 Output the information message level 1 and above.
#define VERBOSE_MSG_INFO2   4
 Output the information message level 2 and above.
#define VERBOSE_MSG_INFO3   5
 Output the information message level 3 and above.
#define VERBOSE_MSG_INFO4   6
 Output the information message level 4 and above.
#define VERBOSE_MSG_INFO5   7
 Output the information message level 5 and above.
#define VERBOSE_MSG_INFO6   8
 Output the information message level 6 and above.

Functions

gint verboseMsg_get_level ()
 Get the current verbose level.
void verboseMsg_set_level (gint verboseLevel)
 Set the current verbose level.
gint verboseMsg_get_fileLevel ()
 Get the file verbose level.
void verboseMsg_set_fileLevel (gint fileVerboseLevel)
 Set the file verbose level.
void verboseMsg_set_logFile (FILE *outputFile)
 Set the log file.
gint verboseMsg_print (gint verboseLevel, const gchar *format,...)
 Output Verbose message.
void verboseMsg_increase_level (gint difference)
 Increase or decrease verbose level.


Detailed Description

Verbose messages show critical errors, errors, warnings, and various messages for information or debugging use.

They can display on screen, depending on the current verbose level and message verbose level. If verbose level messages are lesser than or equals to the current verbose level, the message will show on screen; otherwise the message will be ignored and not showing.

Similarly, the verbose messages can save to log files, depending on the file verbose level. If verbose level messages are lesser than or equals to the file verbose level, the message will print to the given log file; otherwise the message will not appear in log file. See also verboseMsg_print().


Function Documentation

gint verboseMsg_get_fileLevel (  ) 

Returns:
file verbose level.

gint verboseMsg_get_level (  ) 

Returns:
current verbose level.

void verboseMsg_increase_level ( gint  difference  ) 

This function can increase the verbose level by setting a positive difference; while setting a negative difference decrease the verbose level.

Parameters:
difference The amount of verbose level be changed.

gint verboseMsg_print ( gint  verboseLevel,
const gchar *  format,
  ... 
)

This function prints the verbose to screen, and log files. if the outputFile in verboseMsg_set_logFile() is given. The message will be displayed on screen if verboseLevel is lesser or equal to current verbose level. The message will also be printed to the log if the outputFile is given and verboseLevel is lesser or equal to file verbose level.

The rest of this function works like fprintf.

Parameters:
verboseLevel 
format 
... 
Returns:
same as printf/fprintf
See also:
verboseMsg_set_logFile()

void verboseMsg_set_fileLevel ( gint  fileVerboseLevel  ) 

Parameters:
fileVerboseLevel the verbose level to be set as file verbose level.

void verboseMsg_set_level ( gint  verboseLevel  ) 

Parameters:
verboseLevel the verbose level to be set as current verbose level.

void verboseMsg_set_logFile ( FILE *  outputFile  ) 

Parameters:
outputFile Output file.


Generated on Tue Jan 13 10:49:25 2009 for libUnihan by  doxygen 1.5.7.1