增加MESA_handle_logger
This commit is contained in:
33
common/src/log.cpp
Normal file
33
common/src/log.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "log.h"
|
||||
|
||||
void *g_default_logger = NULL;
|
||||
|
||||
// return 0 : success
|
||||
// return -1 : error
|
||||
int LOG_INIT(const char *profile)
|
||||
{
|
||||
if (0 != MESA_handle_runtime_log_creation(profile))
|
||||
{
|
||||
fprintf(stderr, "FATAL: unable to create runtime logger\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
g_default_logger = MESA_create_runtime_log_handle("sce", RLOG_LV_DEBUG);
|
||||
if (g_default_logger == NULL)
|
||||
{
|
||||
fprintf(stderr, "FATAL: unable to create log handle\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void LOG_CLOSE(void)
|
||||
{
|
||||
MESA_handle_runtime_log_destruction();
|
||||
}
|
||||
|
||||
void LOG_RELOAD(void)
|
||||
{
|
||||
MESA_handle_runtime_log_reconstruction(NULL);
|
||||
}
|
||||
Reference in New Issue
Block a user