diff --git a/ChangeLog b/ChangeLog index 660db006..1639fa78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23770,3 +23770,6 @@ 2022-12-07 Fred Gleason * Extended the 'LogSearchStrings=' directive in rd.conf(5) to include searches for podcast items. +2022-12-07 Fred Gleason + * Added a 'LogLogRefresh=' directive to the '[Debugging]' + section of rd.conf(5). diff --git a/conf/rd.conf-sample b/conf/rd.conf-sample index 9095aa5d..49300655 100644 --- a/conf/rd.conf-sample +++ b/conf/rd.conf-sample @@ -209,9 +209,20 @@ TranscodingDelay=0 ;SuppressRdcatchMeterUpdates=No [Debugging] +; IMPORTANT NOTE: +; The directives in this section can send large amounts of data to the +; syslog. These directives should be enabled for debugging purposes only! + ; Log all filter search strings to the syslog, at the specified priority level. ; See the 'level' parameter in the syslog(3) man page for the set of available ; priority levels. An empty argument disables logging. ; ; LogSearchStrings=LOG_DEBUG LogSearchStrings= + +; Send detailed debugging information to the syslog whenever a log refresh +; is performed in rdairplay(1) or rdvairplayd(8). +; See the 'level' parameter in the syslog(3) man page for the set of available +; priority levels. An empty argument disables logging. +; LogLogRefresh=LOG_DEBUG +LogLogRefresh= \ No newline at end of file diff --git a/lib/rdconfig.cpp b/lib/rdconfig.cpp index 8ab05820..1a2ca166 100644 --- a/lib/rdconfig.cpp +++ b/lib/rdconfig.cpp @@ -411,6 +411,18 @@ int RDConfig::logSearchStringsLevel() const } +bool RDConfig::logLogRefresh() const +{ + return conf_log_log_refresh; +} + + +int RDConfig::logLogRefreshLevel() const +{ + return conf_log_log_refresh_level; +} + + int RDConfig::meterBasePort() const { return conf_meter_base_port; @@ -640,6 +652,9 @@ bool RDConfig::load() conf_log_search_strings_level= SyslogPriorityLevel(profile->stringValue("Debugging","LogSearchStrings",""), &conf_log_search_strings); + conf_log_log_refresh_level= + SyslogPriorityLevel(profile->stringValue("Debugging","LogLogRefresh",""), + &conf_log_log_refresh); conf_meter_base_port= profile->intValue("Hacks","MeterPortBaseNumber",RD_DEFAULT_METER_SOCKET_BASE_UDP_PORT); conf_meter_port_range= @@ -771,6 +786,8 @@ void RDConfig::clear() conf_suppress_rdcatch_meter_updates=false; conf_log_search_strings=false; conf_log_search_strings_level=LOG_DEBUG; + conf_log_log_refresh=false; + conf_log_log_refresh_level=LOG_DEBUG; conf_lock_rdairplay_memory=false; conf_meter_base_port=RD_DEFAULT_METER_SOCKET_BASE_UDP_PORT; conf_meter_port_range=RD_METER_SOCKET_PORT_RANGE; diff --git a/lib/rdconfig.h b/lib/rdconfig.h index 9abacdf1..a9f23597 100644 --- a/lib/rdconfig.h +++ b/lib/rdconfig.h @@ -107,6 +107,8 @@ class RDConfig bool suppressRdcatchMeterUpdates() const; bool logSearchStrings() const; int logSearchStringsLevel() const; + bool logLogRefresh() const; + int logLogRefreshLevel() const; bool enableMixerLogging() const; uid_t uid() const; gid_t gid() const; @@ -182,6 +184,8 @@ class RDConfig bool conf_disable_maint_checks; bool conf_log_search_strings; int conf_log_search_strings_level; + bool conf_log_log_refresh; + int conf_log_log_refresh_level; bool conf_lock_rdairplay_memory; QString conf_save_webget_files_directory; bool conf_suppress_rdcatch_meter_updates; diff --git a/lib/rdlogplay.cpp b/lib/rdlogplay.cpp index bbf4e018..fb14cf3f 100644 --- a/lib/rdlogplay.cpp +++ b/lib/rdlogplay.cpp @@ -623,6 +623,11 @@ bool RDLogPlay::refresh() int running; int first_non_holdover = 0; + if(rda->config()->logLogRefresh()) { + rda->syslog(rda->config()->logLogRefreshLevel(),"log refresh begins..."); + DumpToSyslog(rda->config()->logLogRefreshLevel(),"before refresh:"); + } + if(play_macro_running) { play_refresh_pending=true; return true; @@ -768,6 +773,11 @@ bool RDLogPlay::refresh() emit refreshStatusChanged(false); + if(rda->config()->logLogRefresh()) { + DumpToSyslog(rda->config()->logLogRefreshLevel(),"after refresh:"); + rda->syslog(rda->config()->logLogRefreshLevel(),"...log refresh ends"); + } + return true; } @@ -3385,3 +3395,43 @@ void RDLogPlay::LogTraffic(RDLogLine *logline,RDLogLine::PlaySource src, "`ISCI`='"+RDEscapeString(logline->isci())+"'"; RDSqlQuery::apply(sql); } + + +void RDLogPlay::DumpToSyslog(int prio_lvl,const QString &hdr) const +{ + QString str; + + for(int i=0;itype())+" "; + switch(ll->type()) { + case RDLogLine::Cart: + case RDLogLine::Macro: + str+=QString::asprintf("cartnum: %06u ",ll->cartNumber()); + str+="title: "+ll->title()+" "; + break; + + case RDLogLine::Marker: + case RDLogLine::Track: + case RDLogLine::Chain: + str+="comment: "+ll->markerComment()+" "; + break; + + case RDLogLine::MusicLink: + case RDLogLine::TrafficLink: + str+="event: "+ll->linkEventName()+" "; + str+="start time: "+ll->linkStartTime().toString("hh:mm:ss")+" "; + str+="length: "+RDGetTimeLength(ll->linkLength(),false,false)+" "; + break; + + case RDLogLine::OpenBracket: + case RDLogLine::CloseBracket: + case RDLogLine::UnknownType: + break; + } + str+="\n"; + } + rda->syslog(prio_lvl,"%s\n%s",hdr.toUtf8().constData(), + str.toUtf8().constData()); +} diff --git a/lib/rdlogplay.h b/lib/rdlogplay.h index d02ee96f..0a7fc7d6 100644 --- a/lib/rdlogplay.h +++ b/lib/rdlogplay.h @@ -203,6 +203,7 @@ class RDLogPlay : public RDLogModel bool final=false) const; void LogTraffic(RDLogLine *logline,RDLogLine::PlaySource src, RDAirPlayConf::TrafficAction action,bool onair_flag) const; + void DumpToSyslog(int prio_lvl,const QString &hdr) const; RDCae *play_cae; RDAirPlayConf::OpMode play_op_mode; int play_slot_id[LOGPLAY_MAX_PLAYS];