diff options
author | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-07-06 15:44:41 +0200 |
---|---|---|
committer | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-08-08 17:24:00 +0200 |
commit | dfb4728ebe8b26499cb62e774952110d0dc1c9c1 (patch) | |
tree | 414a936ac3e06f12b752ae053b8928dd271b7da8 | |
parent | a7b321735e4ad641cb35777a99bdce08fa763688 (diff) |
main: use our own log functions
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
-rw-r--r-- | src/main.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp index bf78b52..ed71152 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,7 +6,6 @@ #include <json.h> extern "C" { -#define AFB_BINDING_VERSION 2 #include <afb/afb-binding.h> #include <systemd/sd-event.h> } @@ -114,7 +113,7 @@ char const *init_layout() { int display_event_callback(sd_event_source *evs, int fd, uint32_t events, void *data) { if ((events & EPOLLHUP) != 0) { - AFB_ERROR("The compositor hung up, dying now."); + logerror("The compositor hung up, dying now."); delete g_wayland; g_wayland = nullptr; goto error; @@ -123,7 +122,7 @@ int display_event_callback(sd_event_source *evs, int fd, uint32_t events, if (events & EPOLLIN) { int ret = g_wayland->display->dispatch(); if (ret == -1) { - AFB_ERROR("wl_display_dipatch() returned error %d", + logerror("wl_display_dipatch() returned error %d", g_wayland->display->get_error()); goto error; } @@ -151,23 +150,23 @@ int binding_init_() { lognotice("WinMan ver. %s", WINMAN_VERSION_STRING); if (g_wayland != nullptr) { - AFB_ERROR("Wayland context already initialized?"); + logerror("Wayland context already initialized?"); return 0; } if (getenv("XDG_RUNTIME_DIR") == nullptr) { - AFB_ERROR("Environment variable XDG_RUNTIME_DIR not set"); + logerror("Environment variable XDG_RUNTIME_DIR not set"); goto error; } g_wayland = new wayland; if (g_wayland->init() == -1) { - AFB_ERROR("Could not connect to compositor"); + logerror("Could not connect to compositor"); goto error; } if (char const *e = init_layout()) { - AFB_ERROR("Could not init layout: %s", e); + logerror("Could not init layout: %s", e); goto error; } @@ -176,7 +175,7 @@ int binding_init_() { g_wayland->display->get_fd(), EPOLLIN, display_event_callback, g_wayland); if (ret < 0) { - AFB_ERROR("Could not initialize wayland event handler: %d", -ret); + logerror("Could not initialize wayland event handler: %d", -ret); goto error; } } @@ -195,7 +194,7 @@ int binding_init() noexcept { try { return binding_init_(); } catch (std::exception &e) { - AFB_ERROR("Uncaught exception in binding_init(): %s", e.what()); + logerror("Uncaught exception in binding_init(): %s", e.what()); } return -1; } |