1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-25 12:10:03 +00:00

display: fix logging

This commit is contained in:
François Revol 2020-12-26 18:49:30 +01:00
parent 568de329ef
commit 9a710fe17f
6 changed files with 13 additions and 19 deletions

View File

@ -55,8 +55,7 @@ display_output_console::display_output_console(const std::string &name_)
bool display_output_console::detect() {
if ((out_to_stdout.get(*state) || out_to_stderr.get(*state)) &&
!out_to_ncurses.get(*state)) {
std::cerr << "Display output '" << name << "' enabled in config."
<< std::endl;
DBGP2("Display output '%s' enabled in config.", name.c_str());
return true;
}
return false;

View File

@ -61,8 +61,7 @@ display_output_file::display_output_file(const std::string &name_)
bool display_output_file::detect() {
if (static_cast<unsigned int>(!overwrite_file.get(*state).empty()) != 0u ||
static_cast<unsigned int>(!append_file.get(*state).empty()) != 0u) {
std::cerr << "Display output '" << name << "' enabled in config."
<< std::endl;
DBGP2("Display output '%s' enabled in config.", name.c_str());
return true;
}
return false;

View File

@ -133,8 +133,7 @@ display_output_http::display_output_http() : display_output_base("http") {
bool display_output_http::detect() {
if (/*priv::*/ out_to_http.get(*state)) {
std::cerr << "Display output '" << name << "' enabled in config."
<< std::endl;
DBGP2("Display output '%s' enabled in config.", name.c_str());
return true;
}
return false;

View File

@ -66,8 +66,7 @@ display_output_ncurses::display_output_ncurses()
bool display_output_ncurses::detect() {
if (out_to_ncurses.get(*state)) {
std::cerr << "Display output '" << name << "' enabled in config."
<< std::endl;
DBGP2("Display output '%s' enabled in config.", name.c_str());
return true;
}
return false;

View File

@ -27,6 +27,7 @@
#include <config.h>
#include "display-output.hh"
#include "logging.h"
#include <algorithm>
#include <iostream>
@ -91,9 +92,10 @@ disabled_display_output::disabled_display_output(const std::string &name,
: display_output_base(name) {
priority = -2;
// XXX some generic way of reporting errors? NORM_ERR?
std::cerr << "Support for display output '" << name
<< "' has been disabled during compilation. Please recompile with '"
<< define << "'" << std::endl;
DBGP(
"Support for display output '%s' has been disabled during compilation. "
"Please recompile with '%s'",
name.c_str(), define.c_str());
}
bool initialize_display_outputs() {
@ -108,11 +110,9 @@ bool initialize_display_outputs() {
for (auto output : outputs) {
if (output->priority < 0) continue;
std::cerr << "Testing display output '" << output->name << "'... "
<< std::endl;
DBGP2("Testing display output '%s'... ", output->name.c_str());
if (output->detect()) {
std::cerr << "Detected display output '" << output->name << "'... "
<< std::endl;
DBGP2("Detected display output '%s'... ", output->name.c_str());
if (graphical_count && output->graphical()) continue;
@ -120,8 +120,7 @@ bool initialize_display_outputs() {
active_display_outputs.push_back(output);
if (output->initialize()) {
std::cerr << "Initialized display output '" << output->name << "'... "
<< std::endl;
DBGP("Initialized display output '%s'... ", output->name.c_str());
output->is_active = true;
if (output->graphical()) graphical_count++;

View File

@ -205,8 +205,7 @@ display_output_x11::display_output_x11() : display_output_base("x11") {
bool display_output_x11::detect() {
if (out_to_x.get(*state)) {
std::cerr << "Display output '" << name << "' enabled in config."
<< std::endl;
DBGP2("Display output '%s' enabled in config.", name.c_str());
return true;
}
return false;