+ ObtPaths *p = obt_paths_new();
+ gchar *dir = g_build_filename(obt_paths_cache_home(p),
+ "openbox", NULL);
+
+ /* log messages to a log file! fancy, no? */
+ if (!obt_paths_mkdir_path(dir, 0777))
+ g_message(_("Unable to make directory '%s': %s"),
+ dir, g_strerror(errno));
+ else {
+ gchar *name = g_build_filename(obt_paths_cache_home(p),
+ "openbox", "openbox.log", NULL);
+ log_file = fopen(name, "w");
+ g_free(name);
+ }
+
+ rr_handler_id =
+ g_log_set_handler("ObRender", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL |
+ G_LOG_FLAG_RECURSION, log_handler, NULL);
+ obt_handler_id =
+ g_log_set_handler("Obt", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL |
+ G_LOG_FLAG_RECURSION, log_handler, NULL);
+ ob_handler_id =
+ g_log_set_handler("Openbox", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL |
+ G_LOG_FLAG_RECURSION, log_handler, NULL);
+
+ g_free(dir);