/* spawn editor */
char* command = g_strdup_printf(vb.config.editor_command, file_path);
if (!g_shell_parse_argv(command, &argc, &argv, NULL)) {
- fprintf(stderr, "Could not parse editor-command");
+ g_critical("Could not parse editor-command '%s'", command);
g_free(command);
return RESULT_ERROR;
}
if (!success) {
unlink(file_path);
g_free(file_path);
+ g_warning("Could not spawn editor-command");
return RESULT_ERROR;
}
) {
gboolean success = js_eval(frame, js, file, &value);
if (!success) {
- fprintf(stderr, "%s", value);
+ g_warning("JavaScript error in %s: %s", file, value);
}
g_free(value);
g_free(js);
/* load default config */
for (guint i = 0; default_config[i] != NULL; i++) {
if (!ex_run_string(default_config[i])) {
- fprintf(stderr, "Invalid default config: %s\n", default_config[i]);
+ g_error("Invalid default config: '%s'", default_config[i]);
}
}
continue;
}
if (!ex_run_string(line)) {
- fprintf(stderr, "Invalid config: %s\n", line);
+ g_warning("Invalid user config: '%s'", line);
}
}
}
if (!(g_file_test(filename, G_FILE_TEST_IS_REGULAR)
&& g_file_get_contents(filename, &content, length, &error))
) {
- fprintf(stderr, "Cannot open %s: %s\n", filename, error ? error->message : "file not found");
+ g_warning("Cannot open %s: %s", filename, error ? error->message : "file not found");
g_clear_error(&error);
}
return content;
fp = g_file_open_tmp(PROJECT "-XXXXXX", file, NULL);
if (fp == -1) {
- fprintf(stderr, "Could not create temporary file %s", *file);
+ g_critical("Could not create temp file %s", *file);
g_free(*file);
return false;
}
if (bytes < len) {
close(fp);
unlink(*file);
- fprintf(stderr, "Could not write temporary file %s", *file);
+ g_critical("Could not write temp file %s", *file);
g_free(*file);
return false;