MCProxy

mcproxy/mcproxy/src/hamcast_logging.cpp File Reference

#include "include/hamcast_logging.h"
#include <fstream>
#include <boost/thread.hpp>
#include <boost/date_time.hpp>
#include <boost/thread/pthread/shared_mutex.hpp>
#include <boost/thread/pthread/mutex.hpp>

Functions

hc_log_fun_t hc_get_log_fun ()
void hc_log (int loglvl, const char *func_name, const char *msg)
void hc_set_default_log_fun (int log_lvl)
void hc_set_log_fun (hc_log_fun_t function_ptr)

Function Documentation

hc_log_fun_t hc_get_log_fun (  ) 

Get a pointer to the current active log function.

void hc_log ( int  loglvl,
const char *  func_name,
const char *  msg 
)

Invokes the function pointer returned by hc_get_log_fun() if not NULL.

void hc_set_default_log_fun ( int  log_lvl  ) 

Get a default logging implementation (one logfile per thread).

Parameters:
log_lvl The desired logging level.

References HC_LOG_DEBUG_LVL, HC_LOG_ERROR_LVL, HC_LOG_FATAL_LVL, HC_LOG_INFO_LVL, HC_LOG_WARN_LVL, and hc_set_log_fun().

Referenced by main(), test_log(), and test_mcproxy().

void hc_set_log_fun ( hc_log_fun_t  function_ptr  ) 

Set the log function to function_ptr.

Referenced by hc_set_default_log_fun().