#include <libweston/libweston.h>
#include <libweston/windowed-output-api.h>
#include <libweston/config-parser.h>
+#include <libweston/weston-log.h>
#include "shared/os-compatibility.h"
}
static FILE *logfile;
-//static struct weston_log_scope *log_scope;
-//static struct weston_log_scope *protocol_scope;
static int
log_timestamp(void)
int no_config = 0;
char *config_file = NULL;
int debug_protocol = 0;
+ struct weston_log_context *log_ctx = NULL;
+ struct weston_log_scope *log_scope;
+ struct weston_log_subscriber *logger;
const struct weston_option core_options[] = {
{ WESTON_OPTION_STRING, "backend", 'B', &backend },
return EXIT_SUCCESS;
}
+ log_ctx = weston_log_ctx_compositor_create();
+ if (!log_ctx) {
+ fprintf(stderr, "Failed to initialize weston debug framework.\n");
+ return EXIT_FAILURE;
+ }
+
+ log_scope = weston_compositor_add_log_scope(log_ctx, "log",
+ "agl-compositor log\n",
+ NULL, NULL);
+
log_file_open(log);
weston_log_set_handler(vlog, vlog_continue);
+ logger = weston_log_subscriber_create_log(logfile);
+
if (load_config(&ivi.config, no_config, config_file) < 0)
goto error_signals;
section = weston_config_get_section(ivi.config, "core", NULL, NULL);
if (!signals[i])
goto error_signals;
- ivi.compositor = weston_compositor_create(display, &ivi);
+ ivi.compositor = weston_compositor_create(display, log_ctx, &ivi);
if (!ivi.compositor) {
weston_log("fatal: failed to create compositor.\n");
goto error_signals;
wl_display_destroy_clients(display);
error_compositor:
+ weston_compositor_tear_down(ivi.compositor);
+
+ weston_compositor_log_scope_destroy(log_scope);
+ log_scope = NULL;
+
+ weston_log_ctx_compositor_destroy(ivi.compositor);
weston_compositor_destroy(ivi.compositor);
+ weston_log_subscriber_destroy_log(logger);
+
error_signals:
for (size_t i = 0; i < ARRAY_LENGTH(signals); ++i)
if (signals[i])