summaryrefslogtreecommitdiff
path: root/common/src/log.cpp
blob: 5a6a7cf38859077f1305c31e7b12958421321900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "log.h"

void *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;
    }

    default_logger = MESA_create_runtime_log_handle("packet_adapter", RLOG_LV_DEBUG);
    if (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);
}