log(mpd): trace log setting boolean options

This commit is contained in:
patrick96 2018-03-31 03:20:12 +02:00 committed by NBonaparte
parent d31570fe2f
commit bbe5769bb0

View File

@ -10,6 +10,8 @@
POLYBAR_NS POLYBAR_NS
#define TRACE_BOOL(mode) m_log.trace("mpdconnection.%s: %s", __FUNCTION__, mode ? "true" : "false");
namespace mpd { namespace mpd {
sig_atomic_t g_connection_closed = 0; sig_atomic_t g_connection_closed = 0;
void g_mpd_signal_handler(int signum) { void g_mpd_signal_handler(int signum) {
@ -244,6 +246,7 @@ namespace mpd {
void mpdconnection::pause(bool state) { void mpdconnection::pause(bool state) {
try { try {
TRACE_BOOL(state);
check_prerequisites_commands_list(); check_prerequisites_commands_list();
mpd_run_pause(m_connection.get(), state); mpd_run_pause(m_connection.get(), state);
check_errors(m_connection.get()); check_errors(m_connection.get());
@ -304,6 +307,7 @@ namespace mpd {
void mpdconnection::set_repeat(bool mode) { void mpdconnection::set_repeat(bool mode) {
try { try {
TRACE_BOOL(mode);
check_prerequisites_commands_list(); check_prerequisites_commands_list();
mpd_run_repeat(m_connection.get(), mode); mpd_run_repeat(m_connection.get(), mode);
check_errors(m_connection.get()); check_errors(m_connection.get());
@ -314,6 +318,7 @@ namespace mpd {
void mpdconnection::set_random(bool mode) { void mpdconnection::set_random(bool mode) {
try { try {
TRACE_BOOL(mode);
check_prerequisites_commands_list(); check_prerequisites_commands_list();
mpd_run_random(m_connection.get(), mode); mpd_run_random(m_connection.get(), mode);
check_errors(m_connection.get()); check_errors(m_connection.get());
@ -324,6 +329,7 @@ namespace mpd {
void mpdconnection::set_single(bool mode) { void mpdconnection::set_single(bool mode) {
try { try {
TRACE_BOOL(mode);
check_prerequisites_commands_list(); check_prerequisites_commands_list();
mpd_run_single(m_connection.get(), mode); mpd_run_single(m_connection.get(), mode);
check_errors(m_connection.get()); check_errors(m_connection.get());
@ -334,6 +340,7 @@ namespace mpd {
void mpdconnection::set_consume(bool mode) { void mpdconnection::set_consume(bool mode) {
try { try {
TRACE_BOOL(mode);
check_prerequisites_commands_list(); check_prerequisites_commands_list();
mpd_run_consume(m_connection.get(), mode); mpd_run_consume(m_connection.get(), mode);
check_errors(m_connection.get()); check_errors(m_connection.get());
@ -476,4 +483,6 @@ namespace mpd {
// }}} // }}}
} }
#undef LOG_BOOL
POLYBAR_NS_END POLYBAR_NS_END