Print logging output consistently to stderr
This commit is contained in:
@@ -126,14 +126,14 @@ gboolean read_desktop_file_full_path(const char *path, DesktopEntry *entry)
|
||||
int lang_index_default = 1;
|
||||
#define LANG_DBG 0
|
||||
if (LANG_DBG)
|
||||
printf("Languages:");
|
||||
fprintf(stderr, "Languages:");
|
||||
for (int i = 0; languages[i]; i++) {
|
||||
lang_index_default = i + 1;
|
||||
if (LANG_DBG)
|
||||
printf(" %s", languages[i]);
|
||||
fprintf(stderr, " %s", languages[i]);
|
||||
}
|
||||
if (LANG_DBG)
|
||||
printf("\n");
|
||||
fprintf(stderr, "\n");
|
||||
// we currently do not know about any Name key at all, so use an invalid index
|
||||
int lang_index_name = lang_index_default + 1;
|
||||
int lang_index_generic_name = lang_index_default + 1;
|
||||
@@ -281,7 +281,7 @@ void test_read_desktop_file()
|
||||
fprintf(stdout, "\033[1;33m");
|
||||
DesktopEntry entry;
|
||||
read_desktop_file("/usr/share/applications/firefox.desktop", &entry);
|
||||
printf("Name:%s GenericName:%s Icon:%s Exec:%s\n", entry.name, entry.generic_name, entry.icon, entry.exec);
|
||||
fprintf(stderr, "Name:%s GenericName:%s Icon:%s Exec:%s\n", entry.name, entry.generic_name, entry.icon, entry.exec);
|
||||
fprintf(stdout, "\033[0m");
|
||||
}
|
||||
|
||||
|
||||
@@ -330,19 +330,19 @@ void test_launcher_read_theme_file()
|
||||
fprintf(stdout, "\033[1;33m");
|
||||
IconTheme *theme = load_theme("oxygen");
|
||||
if (!theme) {
|
||||
printf("Could not load theme\n");
|
||||
fprintf(stderr, "Could not load theme\n");
|
||||
return;
|
||||
}
|
||||
printf("Loaded theme: %s\n", theme->name);
|
||||
fprintf(stderr, "Loaded theme: %s\n", theme->name);
|
||||
GSList *item = theme->list_inherits;
|
||||
while (item != NULL) {
|
||||
printf("Inherits:%s\n", (char *)item->data);
|
||||
fprintf(stderr, "Inherits:%s\n", (char *)item->data);
|
||||
item = g_slist_next(item);
|
||||
}
|
||||
item = theme->list_directories;
|
||||
while (item != NULL) {
|
||||
IconThemeDir *dir = item->data;
|
||||
printf("Dir:%s Size=%d MinSize=%d MaxSize=%d Threshold=%d Type=%s\n",
|
||||
fprintf(stderr, "Dir:%s Size=%d MinSize=%d MaxSize=%d Threshold=%d Type=%s\n",
|
||||
dir->name,
|
||||
dir->size,
|
||||
dir->min_size,
|
||||
@@ -623,10 +623,10 @@ char *get_icon_path_helper(GSList *themes, const char *icon_name, int size)
|
||||
// filename = directory/$(themename)/subdirectory/iconname.extension
|
||||
sprintf(file_name, "%s/%s/%s/%s%s", base_name, theme_name, dir_name, icon_name, extension);
|
||||
if (debug_icons)
|
||||
printf("Checking %s\n", file_name);
|
||||
fprintf(stderr, "Checking %s\n", file_name);
|
||||
if (g_file_test(file_name, G_FILE_TEST_EXISTS)) {
|
||||
if (debug_icons)
|
||||
printf("Found potential match: %s\n", file_name);
|
||||
fprintf(stderr, "Found potential match: %s\n", file_name);
|
||||
// Closest match
|
||||
if (directory_size_distance((IconThemeDir *)dir->data, size) < minimal_size &&
|
||||
(!best_file_theme ? 1 : theme == best_file_theme)) {
|
||||
@@ -638,7 +638,7 @@ char *get_icon_path_helper(GSList *themes, const char *icon_name, int size)
|
||||
minimal_size = directory_size_distance((IconThemeDir *)dir->data, size);
|
||||
best_file_theme = theme;
|
||||
if (debug_icons)
|
||||
printf("best_file_name = %s; minimal_size = %d\n", best_file_name, minimal_size);
|
||||
fprintf(stderr, "best_file_name = %s; minimal_size = %d\n", best_file_name, minimal_size);
|
||||
}
|
||||
// Next larger match
|
||||
if (((IconThemeDir *)dir->data)->size >= size &&
|
||||
@@ -652,7 +652,7 @@ char *get_icon_path_helper(GSList *themes, const char *icon_name, int size)
|
||||
next_larger_size = ((IconThemeDir *)dir->data)->size;
|
||||
next_larger_theme = theme;
|
||||
if (debug_icons)
|
||||
printf("next_larger = %s; next_larger_size = %d\n", next_larger, next_larger_size);
|
||||
fprintf(stderr, "next_larger = %s; next_larger_size = %d\n", next_larger, next_larger_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -683,10 +683,10 @@ char *get_icon_path_helper(GSList *themes, const char *icon_name, int size)
|
||||
// filename = directory/iconname.extension
|
||||
sprintf(file_name, "%s/%s%s", base_name, icon_name, extension);
|
||||
if (debug_icons)
|
||||
printf("Checking %s\n", file_name);
|
||||
fprintf(stderr, "Checking %s\n", file_name);
|
||||
if (g_file_test(file_name, G_FILE_TEST_EXISTS)) {
|
||||
if (debug_icons)
|
||||
printf("Found %s\n", file_name);
|
||||
fprintf(stderr, "Found %s\n", file_name);
|
||||
g_slist_free(extensions);
|
||||
return file_name;
|
||||
} else {
|
||||
|
||||
@@ -297,7 +297,7 @@ gboolean resize_launcher(void *obj)
|
||||
launcherIcon->y = posy;
|
||||
launcherIcon->x = posx;
|
||||
launcher_icon_on_change_layout(launcherIcon);
|
||||
// printf("launcher %d : %d,%d\n", i, posx, posy);
|
||||
// fprintf(stderr, "launcher %d : %d,%d\n", i, posx, posy);
|
||||
if (panel_horizontal) {
|
||||
if (i % icons_per_column) {
|
||||
posy += launcher->icon_size + launcher->area.paddingx;
|
||||
|
||||
@@ -420,7 +420,7 @@ XSettingsClient *xsettings_client_new(Display *display,
|
||||
check_manager_window(client);
|
||||
|
||||
if (client->manager_window == None) {
|
||||
printf("No XSETTINGS manager, tint2 uses config option 'launcher_icon_theme'.\n");
|
||||
fprintf(stderr, "No XSETTINGS manager, tint2 uses config option 'launcher_icon_theme'.\n");
|
||||
free(client);
|
||||
return NULL;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user