summaryrefslogtreecommitdiff
path: root/common/src/log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/log.cpp')
-rw-r--r--common/src/log.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/common/src/log.cpp b/common/src/log.cpp
new file mode 100644
index 0000000..5a6a7cf
--- /dev/null
+++ b/common/src/log.cpp
@@ -0,0 +1,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);
+}