增加MESA_handle_logger

This commit is contained in:
luwenpeng
2023-02-20 11:16:34 +08:00
parent 6eaad28f9c
commit 82ac815b68
10 changed files with 108 additions and 95 deletions

33
common/src/log.cpp Normal file
View 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);
}