aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-10-25 23:07:42 +0100
committerBoris Faure <billiob@gmail.com>2015-10-25 23:09:36 +0100
commit099512a6f8acbb4647fb120c598699c1c8fbdaad (patch)
treede8b7fe51a043fde666bdb25d7fd5f84a4af0e68
parentadd code to fuzz terminology (wip) (diff)
downloadterminology-devs/billiob/fuzz.tar.gz
ugly code to log to syslogdevs/billiob/fuzz
-rw-r--r--src/bin/main.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index 3559410..01e8b95 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -437,6 +437,40 @@ _translate_options(void)
}
#endif
+#include <syslog.h>
+static void
+_my_log_cb(const Eina_Log_Domain *d,
+ Eina_Log_Level level,
+ const char *file,
+ const char *fnc,
+ int line,
+ const char *fmt,
+ void *data,
+ va_list args)
+{
+ int priority;
+ switch (level) {
+ case EINA_LOG_LEVEL_CRITICAL:
+ priority = LOG_CRIT;
+ break;
+ case EINA_LOG_LEVEL_ERR:
+ priority = LOG_ERR;
+ break;
+ case EINA_LOG_LEVEL_WARN:
+ priority = LOG_WARNING;
+ break;
+ case EINA_LOG_LEVEL_INFO:
+ priority = LOG_INFO;
+ break;
+ case EINA_LOG_LEVEL_DBG:
+ priority = LOG_DEBUG;
+ break;
+ default:
+ priority = level + LOG_CRIT;
+ }
+ vsyslog(priority, fmt, args);
+}
+
EAPI_MAIN int
elm_main(int argc, char **argv)
{