BeBOP: pOSKI  v1.0.0
parallel Optimized Sparse Kernel Interface library
 All Files Functions Variables
Functions | Variables
poski_MessageHandler.c File Reference

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.

Detailed Description

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.

Attention:
These routines are usually for the library's internal use and should not normally be called directly by users.
Called by poski_InitCloseHandler.c

Also, refer poski_LogFileHandler.c


Function Documentation

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).

Parameters:
[in]levelLevel at and above which this message should be printed.
[in]fmtA 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.

Parameters:
[in]func_nameThe function name which occurs an error.
[in]msgA 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.

Parameters:
[in]func_nameThe function name which occurs an warning.
[in]msgA printf-compatible format string for the warning message.
[in]...Options for the formatting string.