#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. |
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().
gint verboseMsg_get_fileLevel | ( | ) |
gint verboseMsg_get_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.
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.
verboseLevel | ||
format | ||
... |
void verboseMsg_set_fileLevel | ( | gint | fileVerboseLevel | ) |
fileVerboseLevel | the verbose level to be set as file verbose level. |
void verboseMsg_set_level | ( | gint | verboseLevel | ) |
verboseLevel | the verbose level to be set as current verbose level. |
void verboseMsg_set_logFile | ( | FILE * | outputFile | ) |
outputFile | Output file. |