BeBOP: pOSKI
v1.0.0
parallel Optimized Sparse Kernel Interface library
|
Handle the output messages. More...
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stdarg.h>
#include <poski/poski_print.h>
#include <poski/poski_system.h>
Functions | |
void | poski_InitSetMessageLevel (void) |
[library's internal use] Set message level based on the environment variable POSKI_MESSAGE_LEVEL. | |
void | poski_printMessage (unsigned level, const char *fmt,...) |
Print an message. | |
void | poski_error (const char *func_name, const char *msg,...) |
Report an error message. | |
void | poski_warning (const char *func_name, const char *msg,...) |
Report a warning message. | |
Variables | |
FILE * | poski_logfile |
[library's internal use] File to where output messages should be directed. | |
static unsigned | g_curr_message_level = 0 |
[library's internal use] Current message level. |
Handle the output messages.
This module implements the output message handler routines based on the environment variable POSKI_MESSAGE_LEVEL.
NOTE: If the library is build with pthread support, these routines are thread-safe using pthread mutex.
Also, refer poski_LogFileHandler.c
void poski_InitSetMessageLevel | ( | void | ) |
[library's internal use] Set message level based on the environment variable POSKI_MESSAGE_LEVEL.
NOTE: This routine is for the library's internal use only and should not normally be called directly by users.
void poski_printMessage | ( | unsigned | level, |
const char * | fmt, | ||
... | |||
) |
Print an message.
The message is displayed to the <poski_logfile> only if level >= the current message level (g_curr_message_level).
[in] | level | Level at and above which this message should be printed. |
[in] | fmt | A printf-compatible format string. |
[in] | ... | Options for the formatting string. |
void poski_error | ( | const char * | func_name, |
const char * | msg, | ||
... | |||
) |
Report an error message.
The error message is displayed to the <poski_logfile> when an error is occured.
[in] | func_name | The function name which occurs an error. |
[in] | msg | A printf-compatible format string for the error message. |
[in] | ... | Options for the formatting string. |
void poski_warning | ( | const char * | func_name, |
const char * | msg, | ||
... | |||
) |
Report a warning message.
The warning message is displayed to the <poski_logfile> when an warning is occured.
[in] | func_name | The function name which occurs an warning. |
[in] | msg | A printf-compatible format string for the warning message. |
[in] | ... | Options for the formatting string. |