]> git.vomp.tv Git - vompclient.git/commitdiff
Log conversion
authorChris Tallon <chris@vomp.tv>
Sat, 4 Sep 2021 14:05:23 +0000 (15:05 +0100)
committerChris Tallon <chris@vomp.tv>
Sat, 4 Sep 2021 14:05:23 +0000 (15:05 +0100)
55 files changed:
GNUmakefile
boxstack.cc
config.json.sample
demuxer.cc
demuxerts.cc
demuxervdr.cc
i18n.cc
imageomx.cc
inputcec.cc
inputlinux.cc
log.h
main.cc
objects.mk
oldlog.cc [deleted file]
oldlog.h [deleted file]
osdopenvg.cc
playerradiolive.cc
playerradiolive.h
playerradiorec.cc
playerradiorec.h
recman.cc
sleeptimer.cc
sleeptimer.h
stream.cc
surface.cc
tbboxx.cc
tfeed.cc
vaudioselector.cc
vchannelselect.cc
vconnect.cc
vconnect.h
vdr.h
vepg.cc
vepglistadvanced.cc
vepgsettimer.cc
vepgsettimer.h
vopts.cc
vpicturebanner.cc
vradiorec.cc
vrecording.cc
vrecordinglist.cc
vrecordinglistadvanced.cc
vrecordinglistclassic.cc
vscreensaver.cc
vteletextview.cc
vtimerlist.cc
vvideorec.cc
vwelcome.cc
wjpeg.cc
wjpegsimple.cc
woptionbox.cc
woptionpane.cc
wremoteconfig.cc
wselectlist.cc
wtabbar.cc

index 1e8c8186ad4c8be4723cc65e4dea1b55201a23c1..45e607b6e2cff53f47b56d94cbf00ba2129f5801 100644 (file)
@@ -104,8 +104,8 @@ endif
 
 
 
-#CXXFLAGS_DEV = $(DEFINES) -DDEV -g -O0 -Wall -Wextra -Wshadow -Werror=return-type -Wmissing-format-attribute -Wdisabled-optimization -Wmissing-declarations -Wmissing-noreturn -Winit-self -Woverloaded-virtual -Wold-style-cast -Wconversion -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES)
-CXXFLAGS_DEV = $(DEFINES) -DDEV -g -O0 -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES)
+CXXFLAGS_DEV = $(DEFINES) -DDEV -g -O0 -Wall -Wextra -Wshadow -Werror=return-type -Wmissing-format-attribute -Wdisabled-optimization -Wmissing-declarations -Wmissing-noreturn -Winit-self -Woverloaded-virtual -Wold-style-cast -Wconversion -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES)
+#CXXFLAGS_DEV = $(DEFINES) -DDEV -g -O0 -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES)
 CXXFLAGS_REL = $(DEFINES) -O3 -Wall -Werror -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES)
 
 .PHONY: clean fresh all install strip
index 4161cd541fec888c1908d9f1bd303aaa17f3b13e..248b17e4ad62e8b0f5997b7a6a9083da952885ea 100644 (file)
@@ -21,7 +21,9 @@
 
 #include "messagequeue.h"
 #include "input.h"
-#include "oldlog.h"
+#include "log.h"
+
+static const char* TAG = "BoxStack";
 
 BoxStack* BoxStack::instance = NULL;
 
@@ -76,13 +78,13 @@ int BoxStack::addVideoDisplay(Boxx* box,VideoDisplay vd)
 int BoxStack::add(Boxx* v)
 {
   if (!initted) return 0;
-  Log::getInstance()->log("BoxStack", Log::DEBUG, "add called"); 
+  LogNT::getInstance()->debug(TAG, "add called");
   boxLock.lock();
-  Log::getInstance()->log("BoxStack", Log::DEBUG, "Locked for add");  
+  LogNT::getInstance()->debug(TAG, "Locked for add");
   
   if (numBoxes == 16)
   { //Error
-    Log::getInstance()->log("BoxStack", Log::ERR, "More than 16 boxes! Unlocked for add"); 
+    LogNT::getInstance()->error(TAG, "More than 16 boxes! Unlocked for add");
     boxLock.unlock();
     return 0;
   }
@@ -90,13 +92,13 @@ int BoxStack::add(Boxx* v)
   boxLock.unlock();
   VideoDisplay vd;
   if (v->getVideoDisplay(vd)) {
-         Log::getInstance()->log("BoxStack", Log::DEBUG, "Add video display");
+         LogNT::getInstance()->debug(TAG, "Add video display");
          addVideoDisplay(v,vd);
   }
 
 
 
-  Log::getInstance()->log("BoxStack", Log::DEBUG, "Unlocked for add");
+  LogNT::getInstance()->debug(TAG, "Unlocked for add");
   
   return 1;
 }
@@ -109,16 +111,16 @@ int BoxStack::remove(Boxx* toDelete)
   VideoDisplay *display = NULL;
 
   boxLock.lock();
-  Log::getInstance()->log("BoxStack", Log::DEBUG, "Locked for remove");  
+  LogNT::getInstance()->debug(TAG, "Locked for remove");
   
   if (numBoxes == 0)
   {
     boxLock.unlock();
-    Log::getInstance()->log("BoxStack", Log::ERR, "Unlocked for remove numBoxes == 0");  
+    LogNT::getInstance()->error(TAG, "Unlocked for remove numBoxes == 0");
     return 0;
   }
 
-//  Log::getInstance()->log("BoxStack", Log::DEBUG, "entering remove, numBoxes=%i", numBoxes);
+//  LogNT::getInstance()->debug(TAG, "entering remove, numBoxes={}", numBoxes);
 
   int i;
 
@@ -132,7 +134,7 @@ int BoxStack::remove(Boxx* toDelete)
     // to be deleted box is more likely to be at the top
     for (i = numBoxes-1; i >= 0; i--)
     {
-//      Log::getInstance()->log("BoxStack", Log::DEBUG, "todel: %p, i=%i, boxes[i]=%p", toDelete, i, boxes[i]);
+//      LogNT::getInstance()->debug(TAG, "todel: {}, i={}, boxes[i]={}", (void*)toDelete, i, (void*)boxes[i]);
       if (boxes[i] == toDelete) break;
     }
 
@@ -141,7 +143,7 @@ int BoxStack::remove(Boxx* toDelete)
       // not a Box we have!
       // FIXME
       boxLock.unlock();
-      Log::getInstance()->log("BoxStack", Log::ERR, "Unlocked for remove - no boxx deleted");  
+      LogNT::getInstance()->error(TAG, "Unlocked for remove - no boxx deleted");
       return 0;
     }
   }
@@ -152,7 +154,7 @@ int BoxStack::remove(Boxx* toDelete)
 
   boxLock.lock();
 
-  //Log::getInstance()->log("BoxStack", Log::DEBUG, "Starting repaintRevealed loop");
+  //LogNT::getInstance()->debug(TAG, "Starting repaintRevealed loop");
   RegionList rl;
   boxSplit(boxes[i]->area, i + 1, numBoxes, 1, rl);
   while(!rl.empty())
@@ -160,7 +162,7 @@ int BoxStack::remove(Boxx* toDelete)
     repaintRevealed(i, rl.front());
     rl.pop_front();
   }
-  //Log::getInstance()->log("BoxStack", Log::DEBUG, "Done repaintRevealed loop");
+  //LogNT::getInstance()->debug(TAG, "Done repaintRevealed loop");
 
   // Shift the boxes on top down one
   --numBoxes;
@@ -180,18 +182,18 @@ int BoxStack::remove(Boxx* toDelete)
     if (!videoStack.empty()) display=&videoStack.top().second;
   }
   boxLock.unlock();
-  Log::getInstance()->log("BoxStack", Log::DEBUG, "Unlocked for remove");  
+  LogNT::getInstance()->debug(TAG, "Unlocked for remove");
  
   // Delete the box
   //AVO: do this delete outside the lock to allow for recursive calls within the destructor
   //     as this box is not in the stack any more, there is no chance for a second delete
-  Log::getInstance()->log("BoxStack", Log::DEBUG, "remove: going to delete boxx %p, num %d", toDelete, numBoxes);  
+  LogNT::getInstance()->debug(TAG, "remove: going to delete boxx {}, num {}", (void*)toDelete, numBoxes);
   delete toDelete;
 
   osd->doRender();
 
   if  (display) {
-         Log::getInstance()->log("BoxStack", Log::DEBUG, "setVideoDisplay %d %d %d %d %d %d", display->mode, display->fallbackMode,
+         LogNT::getInstance()->debug(TAG, "setVideoDisplay {} {} {} {} {} {}", display->mode, display->fallbackMode,
                          display->x, display->y, display->width, display->height);
          Video::getInstance()->setVideoDisplay(*display);
   }
@@ -214,10 +216,10 @@ void BoxStack::redrawAllBoxes()
 
 void BoxStack::update(Boxx* toUpdate, const Region* regionToUpdate)
 {
-//  Log::getInstance()->log("BoxStack", Log::DEBUG, "Update called");
+//  LogNT::getInstance()->debug(TAG, "Update called");
   if (!initted) return; // it is allowed to call this before init
   boxLock.lock();
-//  Log::getInstance()->log("BoxStack", Log::DEBUG, "Locked for update");
+//  LogNT::getInstance()->debug(TAG, "Locked for update");
 
   // Get the z index of the box
   int z = 0;
@@ -232,7 +234,7 @@ void BoxStack::update(Boxx* toUpdate, const Region* regionToUpdate)
     {
       // not a Box we have!
       boxLock.unlock();
-      Log::getInstance()->log("BoxStack", Log::ERR, "Unlocked for update! box not inside boxstack");
+      LogNT::getInstance()->error(TAG, "Unlocked for update! box not inside boxstack");
       return;
     }
   }
@@ -243,7 +245,7 @@ void BoxStack::update(Boxx* toUpdate, const Region* regionToUpdate)
 
   if (!toUpdate) {
       boxLock.unlock();
-         Log::getInstance()->log("BoxStack", Log::DEBUG, "Unlocked for update, no box present");
+         LogNT::getInstance()->debug(TAG, "Unlocked for update, no box present");
          return ;
   }
 
@@ -276,7 +278,7 @@ void BoxStack::update(Boxx* toUpdate, const Region* regionToUpdate)
   }
 
   boxLock.unlock();
-//  Log::getInstance()->log("BoxStack", Log::DEBUG, "Unlocked for update");
+//  LogNT::getInstance()->debug(TAG, "Unlocked for update");
 }
 
 void BoxStack::repaintRevealed(int x, Region r)
@@ -469,7 +471,7 @@ void BoxStack::removeAllExceptWallpaper()
     }
     else
     {
-      Log::getInstance()->log("BoxStack", Log::ERR, "Can this actually happen? Why?");
+      LogNT::getInstance()->error(TAG, "Can this actually happen? Why?");
       toDel = NULL;
     }
 
@@ -481,7 +483,7 @@ void BoxStack::removeAllExceptWallpaper()
     boxLock.unlock();
 
     //AVO: do the delete outside the lock to allow for recursive deletes
-    Log::getInstance()->log("BoxStack", Log::DEBUG, "removeall: going to delete boxx %p, num=%d", toDel, numBoxes);
+    LogNT::getInstance()->debug(TAG, "removeall: going to delete boxx {}, num={}", (void*)toDel, numBoxes);
     if (display) Video::getInstance()->setVideoDisplay(*display);
 
     if (toDel) delete toDel;
@@ -504,7 +506,7 @@ int BoxStack::handleCommand(int command)
 
     for (i=numBoxes-1; i>=0; i--)
     {
-      // Log::getInstance()->log("BoxStack", Log::DEBUG, "Giving command to i=%i", i);
+      // LogNT::getInstance()->debug(TAG, "Giving command to i={}", i);
       retVal = boxes[i]->handleCommand(command);
       if (retVal == 1)
       {
@@ -520,7 +522,7 @@ int BoxStack::handleCommand(int command)
       }
       else if (retVal == 4)
       {
-//        Log::getInstance()->log("BoxStack", Log::DEBUG, "Return 4: i=%i, boxes[i]=%p", i, boxes[i]);
+//        LogNT::getInstance()->debug(TAG, "Return 4: i={}, boxes[i]={}", i, (void*)boxes[i]);
         remove(boxes[i]);
         retVal2 = 1;
         break;
@@ -544,7 +546,7 @@ void BoxStack::processMessage(Message* m)
     {
       if (boxes[i] == m->to)
       {
-        Log::getInstance()->log("BoxStack", Log::DEBUG, "sending message from box %p to box %p %lu", m->from, m->to, m->message);
+        LogNT::getInstance()->debug(TAG, "sending message from box {} to box {} {}", (void*)m->from, (void*)m->to, m->message);
         boxes[i]->processMessage(m);
         return;
       }
@@ -560,7 +562,7 @@ void BoxStack::processMessage(Message* m)
     return;
   }
 
-  Log::getInstance()->log("BoxStack", Log::DEBUG, "it's for meeee!");
+  LogNT::getInstance()->debug(TAG, "it's for meeee!");
 
   switch(m->message)
   {
index 0400f102ad168382307c67a35b2a482a748087df..3bae31926af290acecc91afef3d519aec85470c9 100644 (file)
@@ -8,13 +8,12 @@
 {
   "main":
   {
-    "debug": false,
     "daemonize": true
   },
 
   "log":
   {
-    "enabled": true,
+    "enabled": false,
     "filename": "stdout",
     "level": "debug"
   },
index a91d84aeb54a146109a535e7e2852df22aa6542b..075a8b902bec786257bac883dc2de271557eb342 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "callback.h"
 #include "dvbsubtitles.h"
-#include "oldlog.h"
+#include "log.h"
 
 #include <cstdlib>
 #include <algorithm>
@@ -42,6 +42,8 @@
 
 #define SEEK_THRESHOLD 150000 // About 1.5 seconds
 
+static const char* TAG = "Demuxer";
+
 // Statics
 const int Demuxer::FrameRates[9] = { 0, 23, 24, 25, 29, 30, 50, 59, 60 };
 Demuxer* Demuxer::instance = NULL;
@@ -415,7 +417,7 @@ UINT PESPacket::countPictureHeaders(bool h264, struct PictCountInfo& pinfo) cons
                                  pos+=nalu.getPos();
 
                          } if (testpattern==DEMUXER_H264_CODED_SLICE_IDR || testpattern==DEMUXER_H264_CODED_SLICE_NON_IDR ) {
-                               /*  Log::getInstance()->log("Demuxer", Log::ERR,
+                               /*  LogNT::getInstance()->error(TAG,
                                                                "Has slice %d %d %d %d %d",pinfo.hasaccessunit, pinfo.hassps,pinfo.frame_mbs_only_flag,pinfo.separate_color_plane_flag,
                                                                pinfo.log2_max_frame_num);*/
                                  if (pinfo.hasaccessunit && pinfo.hassps) {
@@ -566,8 +568,7 @@ int Demuxer::init(Callback* tcallback, DrainTarget* audio, DrainTarget* video, D
          !audiostream.init(audio, demuxMemoryA) ||
          !teletextstream.init(teletext, demuxMemoryT))
     {
-      Log::getInstance()->log("Demuxer", Log::CRIT,
-                              "Failed to initialize demuxer");
+      LogNT::getInstance()->crit(TAG, "Failed to initialize demuxer");
       shutdown();
       return 0;
     }
@@ -587,7 +588,7 @@ int Demuxer::init(Callback* tcallback, DrainTarget* audio, DrainTarget* video, D
 
 void Demuxer::reset()
 {
-  Log::getInstance()->log("Demuxer", Log::DEBUG, "Reset called");
+  LogNT::getInstance()->debug(TAG, "Reset called");
   flush();
   video_current = audio_current = teletext_current = subtitle_current = -1;
   horizontal_size = vertical_size = 0;
@@ -627,7 +628,7 @@ int Demuxer::shutdown()
 
 void Demuxer::flush()
 {
-  Log::getInstance()->log("Demuxer", Log::DEBUG, "Flush called");
+  LogNT::getInstance()->debug(TAG, "Flush called");
 
   videostream.flush();
   audiostream.flush();
@@ -669,8 +670,7 @@ void Demuxer::setAspectRatio(enum AspectRatio ar, int taspectx, int taspecty)
 {
   if ((aspect_ratio != ar) || (parx !=  taspectx) || (pary != taspecty) )
   {
-    Log::getInstance()->log("Demux", Log::DEBUG,
-                            "Aspect ratio difference signalled");
+    LogNT::getInstance()->debug(TAG, "Aspect ratio difference signalled");
     if (++arcnt > 3) // avoid changing aspect ratio if glitch in signal
     {
       arcnt = 0;
@@ -810,8 +810,7 @@ void Demuxer::parsePacketDetails(PESPacket& packet)
                 video_pts_seek + (1LL<<33) - audio_pts < SEEK_THRESHOLD) ))
             {
                 aud_seeking = 0;
-                Log::getInstance()->log("Demuxer", Log::DEBUG,
-                    "Leaving  audio sync: Audio PTS = %llu", audio_pts);
+                LogNT::getInstance()->debug(TAG, "Leaving  audio sync: Audio PTS = {}", audio_pts);
             }
         }
     }
@@ -864,7 +863,7 @@ void Demuxer::parsePacketDetails(PESPacket& packet)
                                                                                video_pts_seek + (1LL<<33) - audio_pts < SEEK_THRESHOLD) ))
                                {
                                        aud_seeking = 0;
-                                       Log::getInstance()->log("Demuxer", Log::DEBUG, "Leaving  audio sync: Audio PTS = %llu", audio_pts);
+                                       LogNT::getInstance()->debug(TAG, "Leaving  audio sync: Audio PTS = {}", audio_pts);
                                }
                        }
                        break;
@@ -919,7 +918,7 @@ void Demuxer::parsePacketDetails(PESPacket& packet)
 
                 int commona;
                 int commonb;
-               // Log::getInstance()->log("Demuxer", Log::DEBUG, "PAR test1 %d %d %d %d ", aspectx,aspecty,commona,commonb);
+               // LogNT::getInstance()->debug(TAG, "PAR test1 {} {} {} {}", aspectx, aspecty, commona, commonb);
                 commona=aspectx;
                 commonb=aspecty;
 
@@ -930,7 +929,7 @@ void Demuxer::parsePacketDetails(PESPacket& packet)
                 }
                 aspectx=aspectx/commona;
                 aspecty=aspecty/commona;
-                //Log::getInstance()->log("Demuxer", Log::DEBUG, "PAR test2 %d %d %d %d %d %d %d", aspectx,aspecty,aspectDARx,aspectDARy,horizontal_size,vertical_size,commona);
+                //LogNT::getInstance()->debug(TAG, "PAR test2 {} {} {} {} {} {} {}", aspectx,aspecty,aspectDARx,aspectDARy,horizontal_size,vertical_size,commona);
 
                 setAspectRatio(aspect,aspectx,aspecty);
                 frame_rate = packet[pos+3] & 0x0f;
@@ -1127,10 +1126,8 @@ void Demuxer::parsePacketDetails(PESPacket& packet)
             {
                 vid_seeking = 0;
                 video_pts_seek = video_pts;
-                Log::getInstance()->log("Demuxer", Log::DEBUG,
-                    "Entering audio sync: Video PTS = %llu", video_pts);
-                Log::getInstance()->log("Demuxer", Log::DEBUG,
-                    "Entering audio sync: Audio PTS = %llu", audio_pts);
+                LogNT::getInstance()->debug(TAG, "Entering audio sync: Video PTS = {}", video_pts);
+                LogNT::getInstance()->debug(TAG, "Entering audio sync: Audio PTS = {}", audio_pts);
             }
             return;
         } 
index 4394c49debc82112b52ce37f13bd20d83978bee2..3aff0c19ba5696758d7777e2fa57205d1c26594e 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 #include "demuxerts.h"
-#include "oldlog.h"
+#include "log.h"
 #include "video.h"
 #include "vdr.h"
 #include "audio.h"
@@ -176,7 +176,7 @@ int DemuxerTS::findPTS(UCHAR* buf, int len, ULLONG* dest)
               int pmtpid = (*(curbuf+11)<< 8) | *(curbuf+12);
               if ((pmtpid >> 13) != 0x07) 
               {
-                  Log::getInstance()->log("findPTS", Log::DEBUG, "PMTPID=%02x %02x TRAILING 111 not set but %x", *(curbuf+11),*(curbuf+12), (pmtpid >> 13));
+                  LogNT::getInstance()->debug("findPTS", "PMTPID={:#x} {:#x} TRAILING 111 not set but {:#x}", *(curbuf+11),*(curbuf+12), (pmtpid >> 13));
               } 
               else 
               {
@@ -197,7 +197,7 @@ int DemuxerTS::findPTS(UCHAR* buf, int len, ULLONG* dest)
                   p += 2; //skip ES length
                   if ((foundpid >> 13) != 0x07)
                   {
-                      Log::getInstance()->log("findPTS", Log::DEBUG, "FOUNDPID=%02x %02x TRAILING 111 not set but %x", *(buf+p),*(buf+p+1), (foundpid >> 13));
+                      LogNT::getInstance()->debug("findPTS", "FOUNDPID={:#x} {:#x} TRAILING 111 not set but {:#x}", *(buf+p),*(buf+p+1), (foundpid >> 13));
                   }
                   else 
                   {
@@ -235,14 +235,14 @@ void DemuxerTS::setFrameNum(ULONG frame)
   frameCounting = true;
   frameNumber = frame;
   framereserve=0;
-  Log::getInstance()->log("DemuxerTS", Log::DEBUG, "setFrameNum %d", frame);
+  LogNT::getInstance()->debug("DemuxerTS", "setFrameNum {}", frame);
 }
 
 void DemuxerTS::setPacketNum(ULONG npacket)
 {
   packetCounting = true;
   packetNumber = npacket;
-  Log::getInstance()->log("DemuxerTS", Log::DEBUG, "setPacketNum %d", npacket);
+  LogNT::getInstance()->debug("DemuxerTS", "setPacketNum {}", npacket);
 }
 
 int DemuxerTS::put(UCHAR* buf, int len)
@@ -270,7 +270,7 @@ int DemuxerTS::put(UCHAR* buf, int len)
       else
       { // Packet not terminated. Find another candidate, and shift store
         if (!misaligned_mess) {
-               Log::getInstance()->log("TS Demuxer", Log::ERR, "TS Misaligned!A");
+               LogNT::getInstance()->error("TS Demuxer", "TS Misaligned!A");
                misaligned_mess=true; // do not alarm more than once
         }
         int search = 1;
@@ -293,7 +293,7 @@ int DemuxerTS::put(UCHAR* buf, int len)
   while (len > 0 && *buf != TS_SIG)
   {
          if (!misaligned_mess) {
-                 Log::getInstance()->log("TS Demuxer", Log::ERR, "TS Misaligned!B");
+                 LogNT::getInstance()->error("TS Demuxer", "TS Misaligned!B");
              misaligned_mess=true; // do not alarm more than once
           }
     buf++; ret++; len--;
@@ -358,7 +358,7 @@ int DemuxerTS::processTS(UCHAR* buf)
           int pmtpid = (*(buf+11)<< 8) | *(buf+12);
           if ((pmtpid >> 13) != 0x07) 
           {
-              Log::getInstance()->log("ProcessTS", Log::DEBUG, "PMTPID=%02x %02x TRAILING 111 not set but %x", *(buf+11),*(buf+12), (pmtpid >> 13));
+              LogNT::getInstance()->debug("ProcessTS", "PMTPID={:#x} {:#x} TRAILING 111 not set but {:#x}", *(buf+11),*(buf+12), (pmtpid >> 13));
           } 
           else 
           {
@@ -396,7 +396,7 @@ int DemuxerTS::processTS(UCHAR* buf)
             p += 2; //skip ES length
             if ((foundpid >> 13) != 0x07)
             {
-              Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDPID=%02x %02x TRAILING 111 not set but %x", *(buf+p),*(buf+p+1), (foundpid >> 13));
+              LogNT::getInstance()->debug("ProcessTS", "FOUNDPID={:#x} {:#x} TRAILING 111 not set but {:#x}", *(buf+p),*(buf+p+1), (foundpid >> 13));
             }
             else 
             {
@@ -404,7 +404,7 @@ int DemuxerTS::processTS(UCHAR* buf)
                 bool notfound=false;
                 bool nolang=true;
                 int pos=0;
-           // Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDPID is %x %x", foundpid,streamtype);
+           // LogNT::getInstance()->debug("ProcessTS", "FOUNDPID is {:#x} {:#x}", foundpid,streamtype);
                 switch (streamtype)
                 {
                 case 0x1B: //MPEG 4 for future use
@@ -418,7 +418,7 @@ int DemuxerTS::processTS(UCHAR* buf)
                                        if (streamtype==0x1b) h264=true;
                                        else h264=false;
 
-                //  Log::getInstance()->log("ProcessTS", Log::DEBUG, "Set video PID to %x", foundpid);
+                //  LogNT::getInstance()->debug("ProcessTS", "Set video PID to {:#x}", foundpid);
                         }break;
                 case 0x0F: //AAC ADTS packaging
                 case 0x11: // LATM packaging
@@ -438,7 +438,7 @@ int DemuxerTS::processTS(UCHAR* buf)
                                newapid.desc[2]=buf[p+pos+4];
                                newapid.desc[3]=0;
                                nolang=false;
-                    //         Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDLANG is %s", newapid.desc);
+                    //         LogNT::getInstance()->debug("ProcessTS", "FOUNDLANG is {}", newapid.desc);
                        } break;
                        };
 
@@ -477,7 +477,7 @@ int DemuxerTS::processTS(UCHAR* buf)
                            newapid.desc[3]=0;
                            newapid.data1=(buf[p+pos+5]<<8) |(buf[p+pos+6]);
                            newapid.data2=(buf[p+pos+7]<<8) |(buf[p+pos+8]);
-                        //   Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDSUB is %s", newapid.desc);
+                        //   LogNT::getInstance()->debug("ProcessTS", "FOUNDSUB is {}", newapid.desc);
                             notfound=false;
                             nolang=false;
                                    } break;
@@ -487,7 +487,7 @@ int DemuxerTS::processTS(UCHAR* buf)
                           newapid.desc[2]=buf[p+pos+4];
                           newapid.desc[3]=0;
                           nolang=false;
-                        //  Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDLANG is %s", newapid.desc);
+                        //  LogNT::getInstance()->debug("ProcessTS", "FOUNDLANG is {}", newapid.desc);
                        } break;
                        case 0x56: {
                           type=3;
@@ -732,7 +732,7 @@ int DemuxerTS::processTS(UCHAR* buf)
   if (pid == subID && subActive && subPacket.getLength() == subLength)
   {
     parsePacketDetails(subPacket);
-//Log::getInstance()->log("DEMUXERTS", Log::DEBUG, "SUBMITTING A SUBTITLE PACKET %d %x", subLength, subPacket.getSubstream());
+//LogNT::getInstance()->debug("DEMUXERTS", "SUBMITTING A SUBTITLE PACKET {} {:#x}", subLength, subPacket.getSubstream());
     submitPacket(subPacket);
     subActive = false;
   }
@@ -756,7 +756,7 @@ ULONG DemuxerTS::getFrameNumFromPTS(ULLONG pts)
   while (iter != pts_map.end())
   {
     ++total;
-    //Log::getInstance()->log("DemuxerTS", Log::DEBUG, "getFrameNumfromPTS pts1 %lld pts2 %lld", pts, iter->pts);
+    //LogNT::getInstance()->debug("DemuxerTS", "getFrameNumfromPTS pts1 {} pts2 {}", pts, iter->pts);
     if (PTSDifference(iter->pts, pts) < PTS_ALLOWANCE)
     {
       difference = 0;
@@ -780,7 +780,7 @@ ULONG DemuxerTS::getFrameNumFromPTS(ULLONG pts)
   }
   pts_map_mutex.unlock();
   
- //Log::getInstance()->log("DemuxerTS", Log::DEBUG, "getFrameNumfromPTS pts %lld deleted %d difference %lld", pts, total,difference);
+ //LogNT::getInstance()->debug("DemuxerTS", "getFrameNumfromPTS pts {} deleted {} difference {}", pts, total,difference);
 
   if (difference == (1LL<<33))
     return 0; // We cannot make sense of the pts
@@ -887,13 +887,13 @@ bool DemuxerTS::scanForVideo(UCHAR* buf, UINT len, bool &ish264)
               int pmtpid = (*(curbuf+11)<< 8) | *(curbuf+12);
               if ((pmtpid >> 13) != 0x07) 
               {
-                  Log::getInstance()->log("DemuxerTS", Log::DEBUG, "PMTPID=%02x %02x TRAILING 111 not set but %x", *(curbuf+11),*(curbuf+12), (pmtpid >> 13));
+                  LogNT::getInstance()->debug("DemuxerTS", "PMTPID={:#x} {:#x} TRAILING 111 not set but {:#x}", *(curbuf+11),*(curbuf+12), (pmtpid >> 13));
               } 
               else 
               {
                   pmtpid = pmtpid & 0x1FFF; //clear upper 3 bits
                   pmtpidy = pmtpid;
-                                 Log::getInstance()->log("DemuxerTS", Log::DEBUG, "PMT pid%02x",pmtpid );
+                                 LogNT::getInstance()->debug("DemuxerTS", "PMT pid {:#x}", pmtpid);
               }
           
           } else if (pid == pmtpidy) { //PMT
@@ -909,21 +909,21 @@ bool DemuxerTS::scanForVideo(UCHAR* buf, UINT len, bool &ish264)
                   p += 2; //skip ES length
                   if ((foundpid >> 13) != 0x07)
                   {
-                      Log::getInstance()->log("DemuxerTS", Log::DEBUG, "FOUNDPID=%02x %02x TRAILING 111 not set but %x", *(buf+p),*(buf+p+1), (foundpid >> 13));
+                      LogNT::getInstance()->debug("DemuxerTS", "FOUNDPID={:#x} {:#x} TRAILING 111 not set but {:#x}", *(buf+p),*(buf+p+1), (foundpid >> 13));
                   }
                   else 
                   {
                       foundpid = foundpid & 0x1FFF; //clear upper 3 bits
                    //   int pos=0; UNUSED?
-                                         Log::getInstance()->log("DemuxerTS", Log::DEBUG, "Pid found %02x type %02x",foundpid ,streamtype);
+                                         LogNT::getInstance()->debug("DemuxerTS", "Pid found {:#x} type {:#x}",foundpid ,streamtype);
                       if (streamtype==1 || streamtype ==2) {
                                                  ish264=false;
-                                                 Log::getInstance()->log("DemuxerTS", Log::DEBUG, "Found Mpeg2 Video");
+                                                 LogNT::getInstance()->debug("DemuxerTS", "Found Mpeg2 Video");
                           return true;
                       }
                                          if (streamtype==0x1b) {
                                                  ish264=true;
-                                                 Log::getInstance()->log("DemuxerTS", Log::DEBUG, "Found h264 Video");
+                                                 LogNT::getInstance()->debug("DemuxerTS", "Found h264 Video");
                                                  return true;
                                          }
                   }
index 0e12eff87f8e3afdd63a011fda6099698e7c4b7e..2479972a413344ac03f9fc188822758f28393191 100644 (file)
@@ -20,7 +20,7 @@
 #include "demuxervdr.h"
 #include "video.h"
 #include "dvbsubtitles.h"
-#include "oldlog.h"
+#include "log.h"
 
 #ifndef WIN32
 #include <endian.h>
@@ -33,6 +33,8 @@
 #define PTS_JUMP_MARGIN   10000
 #define PTS_ALLOWANCE 90000
 
+static const char* TAG = "DemuxerVDR";
+
 // TODO: PTS class to handle wrapping arithmetic & comparisons?
 static ULLONG PTSDistance(ULLONG pts1, ULLONG pts2)
 {
@@ -135,14 +137,14 @@ void DemuxerVDR::setFrameNum(ULONG frame)
 {
   frameCounting = true;
   frameNumber = frame;
-  Log::getInstance()->log("Demuxer", Log::DEBUG, "setFrameNum %d", frame);
+  LogNT::getInstance()->debug(TAG, "setFrameNum {}", frame);
 }
 
 void DemuxerVDR::setPacketNum(ULONG npacket)
 {
   packetCounting = true;
   packetNumber = npacket;
-  Log::getInstance()->log("Demuxer", Log::DEBUG, "setPacketNum %d", npacket);
+  LogNT::getInstance()->debug(TAG, "setPacketNum {}", npacket);
 }
 
 int DemuxerVDR::put(UCHAR* buf, int len)
@@ -370,7 +372,7 @@ void DemuxerVDR::parseVDRPacketDetails()
         me.pts = packet.getPTS();
         me.frame = frame_num;
         pts_map_mutex.unlock();
-Log::getInstance()->log("Demuxer", Log::DEBUG, "+* PTS INIT *+ %llu %u", me.pts, me.frame);
+LogNT::getInstance()->debug(TAG, "+* PTS INIT *+ {} {}", me.pts, me.frame);
         pts_map_mutex.lock();
         pts_map.push_front(me);
       }
@@ -383,7 +385,7 @@ Log::getInstance()->log("Demuxer", Log::DEBUG, "+* PTS INIT *+ %llu %u", me.pts,
 
       if (PTSDistance(pts_expected, packet.getPTS()) > PTS_JUMP_MARGIN) // PTS jump!
       {
-Log::getInstance()->log("Demuxer", Log::DEBUG, "+* PTS JUMP *+ %llu %u", packet.getPTS(), frame_num);
+LogNT::getInstance()->debug(TAG, "+* PTS JUMP *+ {} {}", packet.getPTS(), frame_num);
         me.pts = packet.getPTS();
         me.frame = frame_num;
         pts_map_mutex.lock();
diff --git a/i18n.cc b/i18n.cc
index 100aaba17d6b5e8c5e29f929bece707d619399f6..cd4c92c321abe39a7c1bcfb62fef54d668a1e0ed 100644 (file)
--- a/i18n.cc
+++ b/i18n.cc
@@ -29,7 +29,6 @@
 #endif*/
 
 #include "vdr.h"
-#include "oldlog.h"
 
 I18n::trans_table I18n::Translations;
 
index 18ee566ab9219f27104e4d6e1acb2eaee8becf15..84bab65ad2ad196c0e6b3a5fb53ecaa94e4f9dcf 100644 (file)
@@ -18,8 +18,9 @@
 */
 
 #include <bcm_host.h>
+
+#include "log.h"
 #include "videoomx.h"
-#include "oldlog.h"
 #include "vdr.h"
 #include "woptionpane.h"
 #include "util.h"
index 8a8f15edd5d801fac31794f7859e6a6c2ef472c2..f313023bda4ccba2992ca7b229e086ce027cba65 100644 (file)
@@ -24,7 +24,7 @@ using namespace CEC;
 
 #include <bcm_host.h>
 
-#include "oldlog.h"
+#include "log.h"
 #include "vdr.h"
 #include "woptionpane.h"
 #include "inputcec.h"
index 676a4d7a7d9c3133f50cd4f3f8a0facacfb12e68..67c9d0f39dc16d48112eed1034b4613e3d945bbf 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include <stdio.h>
+#include <unistd.h>
 #include <linux/input.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/log.h b/log.h
index 814314d17fa544cb64ce9449f8ec97bdda7be3e6..b21e26d9bd9d5f38e761f5833933d8a7e92d3924 100644 (file)
--- a/log.h
+++ b/log.h
 #include "defines.h"
 
 
+class ExternLogger
+{
+  public:
+    virtual bool LogExtern(const char* message)=0;
+};
+
 class LogNT
 {
   public:
diff --git a/main.cc b/main.cc
index 4cc91a87177bba56f78931112a7e810d7c6c61e7..65b126b77c65a12787074a38ab96fb48b717371a 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -44,7 +44,6 @@
 
 #include "config.h"
 #include "log.h"
-#include "oldlog.h"
 #include "util.h"
 #include "control.h"
 
@@ -63,7 +62,6 @@ void threadSignalReceiverFunction();
 [[ noreturn ]] void shutdown(int code);
 
 Config* config;
-Log* logger;
 LogNT* loggerNT;
 Control* control;
 
@@ -116,24 +114,6 @@ int main(int argc, char** argv)
   }
 
   // Start Log --------------------------------------------------------------------------------------------------
-  logger = new Log();
-  if (!logger)
-  {
-    printf("Failed to create Log object\n");
-    shutdown(1);
-  }
-
-  bool debugEnabled;
-  config->getBool("main", "debug", debugEnabled);
-  if (!logger->init(Log::DEBUG, "dummy", debugEnabled ? 1 : 0)) // NCONFIG x2
-  {
-    printf("Could not initialise log object. Aborting.\n");
-    shutdown(1);
-  }
-
-  logger->log("Main", Log::INFO, "Old log starting up...");
-
-
 
   loggerNT = new LogNT();
   if (!loggerNT)
@@ -144,6 +124,8 @@ int main(int argc, char** argv)
 
   std::string logFileName("stdout");
   config->getString("log", "filename", logFileName);
+  bool debugEnabled;
+  config->getBool("main", "debug", debugEnabled);
   if (!loggerNT->init(logFileName, debugEnabled ? 1 : 0)) // NCONFIG x2
   {
     printf("Could not initialise log object. Aborting.\n");
@@ -291,11 +273,12 @@ void threadSignalReceiverFunction()
   close(fdtty);
 #endif
 
-  if (logger)
+  if (loggerNT)
   {
     loggerNT->info(TAG, "Log module shutting down... bye!\n\n");
-    logger->shutdown();
-    delete logger;
+#warning loggerNT has no shutdown
+    //loggerNT->shutdown();
+    delete loggerNT;
   }
 
   if (config)
index 05d8e96b48c9f9b23f9709d4d06af1b80a3f049f..fb4bbf1c60bc6d97e859f1bc1d7be3bf0206418c 100644 (file)
@@ -1,5 +1,5 @@
 OBJ_COMMON = util.o control.o thread.o timers.o i18n.o udp4.o udp6.o vdpc.o tcp.o  \
-             message.o messagequeue.o wol.o audio.o video.o oldlog.o               \
+             message.o messagequeue.o wol.o audio.o video.o                        \
              vdr.o recman.o recording.o recinfo.o channel.o rectimer.o event.o     \
              directory.o mark.o option.o vfeed.o afeed.o                           \
              demuxer.o demuxervdr.o demuxerts.o stream.o osd.o surface.o           \
diff --git a/oldlog.cc b/oldlog.cc
deleted file mode 100644 (file)
index 558c1ef..0000000
--- a/oldlog.cc
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
-    Copyright 2004-2005 Chris Tallon
-    Copyright 2003-2004 University Of Bradford
-
-    This file is part of VOMP.
-
-    VOMP is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    VOMP is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with VOMP; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*/
-
-#include <sys/types.h>
-
-#ifndef WIN32
-#include <sys/syscall.h>
-#include <unistd.h>
-#endif
-
-#include "vdr.h"
-
-
-#include "oldlog.h"
-
-
-#ifdef __ANDROID__
-#include <android/log.h>
-#endif
-
-Log* Log::instance = NULL;
-
-Log::Log()
-{
-  if (instance) return;
-  instance = this;
-  logfile = NULL;
-  initted = 0;
-  logLevel = 0;
-  extlog = NULL;
-}
-
-Log::~Log()
-{
-  instance = NULL;
-}
-
-Log* Log::getInstance()
-{
-  return instance;
-}
-
-void Log::upLogLevel()
-{
-  if (logLevel == Log::DEBUG)
-  {
-    log("Log", logLevel, "Log level is at its highest already");
-    return;
-  }
-
-  logLevel++;
-  log("Log", logLevel, "Log level is now %i", logLevel);
-}
-
-void Log::downLogLevel()
-{
-  if (logLevel == Log::CRAZY)
-  {
-    log("Log", logLevel, "Log level is at its lowest already");
-    return;
-  }
-
-  logLevel--;
-  log("Log", logLevel, "Log level is now %i", logLevel);
-}
-
-int Log::init(int startLogLevel, const char* fileName, int tenabled)
-{
-  (void)fileName;
-
-  initted = 1;
-  logLevel = startLogLevel;
-  enabled = tenabled;
-
-  // FIXME fix this with NCONFIG
-//  logfile = fopen(fileName, "a");
-//  logfile = fopen(stdout, "a");
-  logfile = stdout;
-//  logfile = fopen("/log", "a");
-
-  if (logfile) return 1;
-  else return 0;
-}
-
-int Log::shutdown()
-{
-  if (!initted) return 1;
-  if (enabled && (logfile != stdout)) fclose(logfile);
-  return 1;
-}
-
-int Log::log(const char *fromModule, int level,const char* message, ...)
-{
-  if (!instance || !logfile) return 0;
-
-  if (!enabled && !extlog) return 1;
-  if (level > logLevel) return 1;
-
-  char buffer[151];
-  int spaceLeft = 150;
-
-#ifndef _MSC_VER
-  struct timeval tv;
-  gettimeofday(&tv, NULL);
-  struct tm tms;
-  LOCALTIME_R(&tv.tv_sec, &tms);
-  spaceLeft -= strftime(buffer, spaceLeft, "%H:%M:%S.", &tms);
-  spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%06lu ", static_cast<unsigned long>(tv.tv_usec));
-#else
-  struct _timeb tb;
-  _ftime(&tb);
-  struct tm* tms = localtime(&tb.time);
-  spaceLeft -= strftime(buffer, spaceLeft, "%H:%M:%S.", tms);
-  spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%06lu ", (unsigned long)tb.millitm);
-#endif
-
-  char levelString[10];
-  if (level == CRAZY)   strcpy(levelString, "[CRAZY] ");
-  if (level == EMERG)   strcpy(levelString, "[EMERG] ");
-  if (level == ALERT)   strcpy(levelString, "[ALERT] ");
-  if (level == CRIT)    strcpy(levelString, "[CRIT]  ");
-  if (level == ERR)     strcpy(levelString, "[ERR]   ");
-  if (level == WARN)    strcpy(levelString, "[WARN]  ");
-  if (level == NOTICE)  strcpy(levelString, "[notice]");
-  if (level == INFO)    strcpy(levelString, "[info]  ");
-  if (level == DEBUG)   strcpy(levelString, "[debug] ");
-
-#ifndef WIN32
-  spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%s %lu %li %s - ", levelString, pthread_self(), syscall(SYS_gettid), fromModule);
-#else
-  spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%s %s - ", levelString,  fromModule);
-#endif
-
-  va_list ap;
-  va_start(ap, message);
-  spaceLeft = VSNPRINTF(&buffer[150-spaceLeft], spaceLeft, message, ap);
-  va_end(ap);
-
-  int messageLength = strlen(buffer);
-  if (messageLength < 150)
-  {
-    buffer[messageLength] = '\n';
-    buffer[messageLength+1] = '\0';
-  }
-  else
-  {
-    buffer[149] = '\n';
-    buffer[150] = '\0';
-  }
-  
-  int success = 1;
-  if (enabled)
-  {
-#ifndef __ANDROID__
-    success = fputs(buffer, logfile);
-    fflush(NULL);
-#else
-    int and_level=0;
-    switch (level) {
-    case CRAZY:
-    case ALERT:
-    case EMERG :
-    case CRIT:{
-       and_level=ANDROID_LOG_FATAL;
-    } break;
-    case ERR: {
-       and_level=ANDROID_LOG_ERROR;
-    } break;
-    case WARN: {
-       and_level=ANDROID_LOG_WARN;
-    } break;
-    case NOTICE:
-    case INFO: {
-        and_level=ANDROID_LOG_INFO;
-    } break;
-    case DEBUG :{
-        and_level=ANDROID_LOG_DEBUG;
-    } break;
-    };
-    __android_log_vprint(and_level, fromModule,
-                             message,  ap);
-#endif
-  }
-
-  if (extlog) extlog->LogExtern(buffer); //Replacement for network logging
-
-
-  if (success != EOF)
-    return 1;
-  else
-    return 0;
-
-}
-
-void Log::logLongString(const char *fromModule, int level,const char *message)
-{
-       int string_size=strlen(message);
-       char buffer[100];
-       const char * pointer=message;
-       for (int str_written=0; str_written<string_size;str_written+=99) {
-               strncpy(buffer,pointer,99);
-               buffer[99]=0;
-               pointer+=99;
-               log(fromModule,level,"%s",buffer);
-       }
-
-}
-
-int Log::status()
-{
-  if (instance && logfile) return 1;
-  else return 0;
-}
-
-void Log::setExternLogger(ExternLogger* login) {
-       extlog=login;
-    log("Log", Log::DEBUG, "Extern logging started");
-}
-
-
-
-
diff --git a/oldlog.h b/oldlog.h
deleted file mode 100644 (file)
index f9869f9..0000000
--- a/oldlog.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-    Copyright 2004-2005 Chris Tallon
-    Copyright 2003-2004 University Of Bradford
-
-    This file is part of VOMP.
-
-    VOMP is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    VOMP is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with VOMP; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*/
-
-#ifndef LOG_H
-#define LOG_H
-
-#include <stdio.h>
-#ifndef WIN32
- #include <unistd.h>
- #include <sys/time.h>
-#else
- #include <sys/timeb.h>
-#endif
-
-#include <time.h>
-#include <string.h>
-#include <stdarg.h>
-#include <sys/types.h>
-#include "defines.h"
-
-
-class ExternLogger {
-public:
-       virtual bool LogExtern(const char* message)=0;
-};
-
-
-class Log
-{
-  public:
-    Log();
-    ~Log();
-    static Log* getInstance();
-
-    int init(int defaultLevel,const char* fileName, int enabled);
-    int shutdown();
-
-    [[deprecated]]
-    int log(const char *fromModule, int level,const char *message, ...);
-
-    [[deprecated]]
-    void logLongString(const char *fromModule, int level,const char *message);
-    int status();
-    void upLogLevel();
-    void downLogLevel();
-    [[deprecated]]
-    void setExternLogger(ExternLogger* log);
-    [[deprecated]]
-    void unsetExternLogger() {
-       extlog=NULL;
-    }
-
-
-
-    const static int CRAZY  = 0; // mad crazy things that should never happen
-    const static int EMERG  = 1; // human assist required NOW
-    const static int ALERT  = 2; // system unusable, but happy to sit there
-    const static int CRIT   = 3; // still working, but maybe about to die
-    const static int ERR    = 4; // that response is not even listed...
-    const static int WARN   = 5; // this could be a bad thing. still running tho
-    const static int NOTICE = 6; // significant good thing
-    const static int INFO   = 7; // verbose good thing
-    const static int DEBUG  = 8; // debug-level messages
-
-  private:
-    static Log* instance;
-    int initted;
-    int logLevel;
-    int enabled;
-
-    FILE *logfile;
-    
-    ExternLogger* extlog;
-
-
-};
-
-#endif
-
-/*
-
-Documentation
--------------
-
-This class is intended to be instatiated once by the core.
-For a one off use:
-
-Log::getInstance()->log("<module-name>", Log::<levelname>, "<message>");
-
-Or, a pointer can be stored and used:
-
-Log *myptr = Log::getInstance();
-
-myptr->log("<module-name>", Log::<levelname>, "<message>");
-myptr->log("<module-name>", Log::<levelname>, "<message>");
-
-Level usages are above.
-
-The message parameter in the log function can be used in the same way as printf, eg.
-
-myptr->log("<module-name>", Log::<levelname>, "Success: %s %i", stringpointer, integer);
-
-*/
index 6fa27786f01f7f7fced804d82503b4e5f7371957..9e60663e8f22514ef4a9b1e424da20c5534f1b19 100644 (file)
@@ -23,7 +23,7 @@
 #include <math.h>
 #include <bcm_host.h>
 
-#include "oldlog.h"
+#include "log.h"
 #include "videoomx.h"
 #include "surface.h"
 #include "message.h"
index 1f745157f8e0df5eb795f233eebbcc7a5572fbd8..f0cf33c94f8b6e60f2d033c711aaef57262c44e0 100644 (file)
@@ -24,7 +24,7 @@
 #include <time.h>
 
 #include "defines.h"
-#include "oldlog.h"
+#include "log.h"
 #include "audio.h"
 #include "demuxerts.h"
 #include "vdr.h"
 
 #include "playerradiolive.h"
 
+static const char* TAG = "PlayerRadioLive";
+
 // ----------------------------------- Called from outside, one offs or info funcs
 
 PlayerRadioLive::PlayerRadioLive(MessageQueue* tmessageQueue, void* tmessageReceiver, ChannelList* tchanList)
 : messageQueue(tmessageQueue), messageReceiver(tmessageReceiver), afeed(this), chanList(tchanList)
 {
   audio = Audio::getInstance();
-  logger = Log::getInstance();
+  logger = LogNT::getInstance();
   vdr = VDR::getInstance();
 
   Video::getInstance()->turnVideoOff();
@@ -62,7 +64,7 @@ int PlayerRadioLive::init()
  
   if (!demuxer->init(this, audio, NULL, NULL, 0, 200000, 0))
   {
-    logger->log("PlayerRadioLive", Log::ERR, "Demuxer failed to init");
+    logger->error(TAG, "Demuxer failed to init");
     shutdown();
     return 0;
   }
@@ -78,7 +80,7 @@ int PlayerRadioLive::shutdown()
   if (!initted) return 0;
   if (state != S_STOP) // FIXME check when this is called and how. This is not thread-sync bullet proof as-is.
   {
-    logger->log("PlayerRadioLive", Log::DEBUG, "state is not stop, calling");
+    logger->debug(TAG, "state is not stop, calling");
     stop();
   }
   initted = false;
@@ -143,18 +145,18 @@ void PlayerRadioLive::go(ULONG index)
 
 void PlayerRadioLive::setChannel(ULONG index)
 {
-  logger->log("PlayerRadioLive", Log::DEBUG, "setChannel");
+  logger->debug(TAG, "setChannel");
   struct PLInstruction i;
   i.instruction = I_SETCHANNEL;
   i.channelIndex = index;
   instructions.push(i);  
-  logger->log("PlayerRadioLive", Log::DEBUG, "posted setChannel instruction, now %i in queue", instructions.size());
+  logger->debug(TAG, "posted setChannel instruction, now {} in queue", instructions.size());
   playerThreadCond.notify_one();
 }
 
 void PlayerRadioLive::stop()
 {
-  logger->log("PlayerRadioLive", Log::DEBUG, "stop");
+  logger->debug(TAG, "stop");
   playerThreadMutex.lock();
   struct PLInstruction i;
   i.instruction = I_STOP;
@@ -162,7 +164,7 @@ void PlayerRadioLive::stop()
   playerThreadCond.notify_one();
   playerThreadMutex.unlock();
   playerThread.join();
-  logger->log("PlayerRadioLive", Log::DEBUG, "stop successful");
+  logger->debug(TAG, "stop successful");
 }
 
 // ----------------------------------- Callback
@@ -204,7 +206,7 @@ void PlayerRadioLive::streamReceive(ULONG flag, void* data, ULONG len)
   {
     // Too many chunks in streamChunks, drop this chunk
     free(data);
-    logger->log("PlayerRadioLive", Log::WARN, "Dropped chunk");
+    logger->warn(TAG, "Dropped chunk");
   }
 }
 
@@ -212,7 +214,7 @@ void PlayerRadioLive::clearStreamChunks()
 {
   while(streamChunks.size())
   {
-    logger->log("PlayerRadioLive", Log::DEBUG, "Dropping chunk from old stream");
+    logger->debug(TAG, "Dropping chunk from old stream");
     struct StreamChunk s = streamChunks.front();
     streamChunks.pop();
     free(s.data);
@@ -223,15 +225,15 @@ void PlayerRadioLive::chunkToDemuxer()
 {
   StreamChunk s = streamChunks.front();
   streamChunks.pop();
-  //logger->log("PlayerRadioLive", Log::DEBUG, "About to call demuxer with %p %lu", s.data, s.len);
+  //logger->debug(TAG, "About to call demuxer with {} {}", (void*)s.data, s.len);
   /*int a =*/ demuxer->put(static_cast<UCHAR*>(s.data), s.len);
-  //logger->log("PlayerRadioLive", Log::DEBUG, "put %i to demuxer", a);
+  //logger->debug(TAG, "put {} to demuxer", a);
   free(s.data);  
 }
 
 void PlayerRadioLive::switchState(UCHAR newState)
 {
-  logger->log("PlayerRadioLive", Log::DEBUG, "Switch from state %u to state %u", state, newState);
+  logger->debug(TAG, "Switch from state {} to state {}", state, newState);
 
   switch(state)
   {
@@ -258,7 +260,7 @@ void PlayerRadioLive::switchState(UCHAR newState)
         }
         default:
         {
-          logger->log("PlayerRadioLive", Log::EMERG, "Thread called state %u to state %u which is not supported", state, newState);
+          logger->crit(TAG, "Thread called state {} to state {} which is not supported", state, newState);
           abort();
           break;
         }
@@ -303,7 +305,7 @@ void PlayerRadioLive::switchState(UCHAR newState)
         }
         default:
         {
-          logger->log("PlayerRadioLive", Log::EMERG, "Thread called state %u to state %u which is not supported", state, newState);
+          logger->crit(TAG, "Thread called state {} to state {} which is not supported", state, newState);
           abort();
           break;
         }        
@@ -342,7 +344,7 @@ void PlayerRadioLive::switchState(UCHAR newState)
         }
         default:
         {
-          logger->log("PlayerRadioLive", Log::EMERG, "Thread called state %u to state %u which is not supported", state, newState);
+          logger->crit(TAG, "Thread called state {} to state {} which is not supported", state, newState);
           abort();
           break;
         }        
@@ -400,7 +402,7 @@ void PlayerRadioLive::threadMethod()
     {
       if (instructions.size() > 1)
       {
-        logger->log("PlayerRadioLive", Log::DEBUG, "Should optimise");
+        logger->debug(TAG, "Should optimise");
         optimizeInstructionQueue();
       }
 
@@ -409,7 +411,7 @@ void PlayerRadioLive::threadMethod()
     
       if (i.instruction == I_SETCHANNEL)
       {
-        logger->log("PlayerRadioLive", Log::DEBUG, "start new stream");
+        logger->debug(TAG, "start new stream");
 
         switchState(S_PREBUFFERING);
 
@@ -429,7 +431,7 @@ void PlayerRadioLive::threadMethod()
               {
                 demuxer->setAID(chan->apids[j].pid, 0, chan->apids[j].type, true);
                 audio->setStreamType(Audio::MPEG2_PES);
-                logger->log("PlayerRadioLive", Log::DEBUG, "Demuxer pids: %u %u %u", chan->vpid, chan->apids[j].pid, chan->apids[j].type);
+                logger->debug(TAG, "Demuxer pids: {} {} {}", chan->vpid, chan->apids[j].pid, chan->apids[j].type);
                 found = true;
               }
               j++;
@@ -447,7 +449,7 @@ void PlayerRadioLive::threadMethod()
                 {
                   demuxer->setAID(chan->dpids[j].pid, 1, chan->dpids[j].type, true);
                   audio->setStreamType(Audio::MPEG2_PES);
-                  logger->log("PlayerRadioLive", Log::DEBUG, "Demuxer pids: %u %u (ac3) %u", chan->vpid, chan->dpids[j].pid, chan->dpids[j].type);
+                  logger->debug(TAG, "Demuxer pids: {} {} (ac3) {}", chan->vpid, chan->dpids[j].pid, chan->dpids[j].type);
                   found=true;
                 }
                 j++;
@@ -455,7 +457,7 @@ void PlayerRadioLive::threadMethod()
             }
             else
             {
-              logger->log("PlayerRadioLive", Log::WARN, "Demuxer no pids!");
+              logger->warn(TAG, "Demuxer no pids!");
             }
           }
 
@@ -473,7 +475,7 @@ void PlayerRadioLive::threadMethod()
       }
       else if (i.instruction == I_STOP)
       {
-        logger->log("PlayerRadioLive", Log::DEBUG, "Stopping");
+        logger->debug(TAG, "Stopping");
         switchState(S_STOP);
         checkError();
         return;
@@ -489,7 +491,7 @@ void PlayerRadioLive::threadMethod()
         ++preBufferCount;
         ULONG percentDone = (preBufferCount * 100) / preBufferAmount;
 
-        logger->log("PlayerRadioLive", Log::DEBUG, "Prebuffering %lu%%", percentDone);
+        logger->debug(TAG, "Prebuffering {}%", percentDone);
         
         Message* m = new Message();
         m->from = this;
@@ -513,5 +515,5 @@ void PlayerRadioLive::threadMethod()
     ul.unlock();
   }
 
-  logger->log("PlayerRadioLive", Log::DEBUG, "End of thread");
+  logger->debug(TAG, "End of thread");
 }
index 6bf4feaced7ee70b03dbf9cde4474afef4e0d5f0..6d38e42eb2fd6a16d4adc32e6a2ed735ed51718d 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <queue>
 
+#include "log.h"
 #include "playerlive.h"
 #include "callback.h"
 #include "defines.h"
@@ -34,7 +35,7 @@
 
 class MessageQueue;
 class Audio;
-class Log;
+class LogNT;
 class DemuxerTS;
 
 class PlayerRadioLive : public PlayerLive, public Callback, public StreamReceiver
@@ -76,7 +77,7 @@ class PlayerRadioLive : public PlayerLive, public Callback, public StreamReceive
   private:
     MessageQueue* messageQueue;
     void* messageReceiver;
-    Log* logger;
+    LogNT* logger;
     Audio* audio;
     DemuxerTS* demuxer;
     VDR* vdr;
index 1ae8a9ba9da41432cb70dd853b25a722471152bd..905f8aa038f40460b08f3148eb646302fd1d81e4 100644 (file)
@@ -23,7 +23,7 @@
 #endif
 #include <time.h>
 
-#include "oldlog.h"
+#include "log.h"
 #include "audio.h"
 #include "video.h"
 #include "demuxervdr.h"
 
 #include "playerradiorec.h"
 
+static const char* TAG = "PlayerRadioRec";
+
 // ----------------------------------- Called from outside, one offs or info funcs
 
 PlayerRadioRec::PlayerRadioRec(MessageQueue* tmessageQueue, void* tmessageReceiver)
 : messageQueue(tmessageQueue), messageReceiver(tmessageReceiver), afeed(this)
 {
   audio = Audio::getInstance();
-  logger = Log::getInstance();
+  logger = LogNT::getInstance();
   vdr = VDR::getInstance();
   Video::getInstance()->turnVideoOff();
 }
@@ -64,7 +66,7 @@ bool PlayerRadioRec::init(ULLONG tlengthBytes, ULONG tlengthFrames, bool isPesRe
 
   if (!demuxer->init(this, audio, NULL, NULL, 0, 40000, 0))
   {
-    logger->log("PlayerRadioRec", Log::ERR, "Demuxer failed to init");
+    logger->error(TAG, "Demuxer failed to init");
     shutdown();
     return false;
   }
@@ -74,7 +76,7 @@ bool PlayerRadioRec::init(ULLONG tlengthBytes, ULONG tlengthFrames, bool isPesRe
   lengthBytes = tlengthBytes;
   lengthFrames = tlengthFrames;
 
-  logger->log("PlayerRadioRec", Log::DEBUG, "PlayerRadioRec has received length bytes of %llu", lengthBytes);
+  logger->debug(TAG, "PlayerRadioRec has received length bytes of {}", lengthBytes);
 
   UINT thisRead = 0;
   int success;
@@ -82,7 +84,7 @@ bool PlayerRadioRec::init(ULLONG tlengthBytes, ULONG tlengthFrames, bool isPesRe
   UCHAR* buffer = vdr->getBlock(0, 10000, &thisRead);
   if (!buffer)
   {
-    logger->log("PlayerRadioRec", Log::ERR, "Failed to get start block");
+    logger->error(TAG, "Failed to get start block");
     shutdown();
     if (!vdr->isConnected()) doConnectionLost();
     return false;
@@ -91,7 +93,7 @@ bool PlayerRadioRec::init(ULLONG tlengthBytes, ULONG tlengthFrames, bool isPesRe
   success = demuxer->findPTS(buffer, thisRead, &startPTS);
   if (!success)
   {
-    logger->log("PlayerRadioRec", Log::ERR, "Failed to get start PTS");
+    logger->error(TAG, "Failed to get start PTS");
     free(buffer);
     shutdown();
     return false;
@@ -101,7 +103,7 @@ bool PlayerRadioRec::init(ULLONG tlengthBytes, ULONG tlengthFrames, bool isPesRe
 
   if (!setLengthSeconds())
   {
-    logger->log("PlayerRadioRec", Log::ERR, "Failed to setLengthSeconds");
+    logger->error(TAG, "Failed to setLengthSeconds");
     shutdown();
     return false;
   }
@@ -118,7 +120,7 @@ bool PlayerRadioRec::setLengthSeconds()
   UCHAR* buffer = vdr->getBlock(lengthBytes - 10000, 10000, &thisRead);
   if (!buffer)
   {
-    logger->log("PlayerRadioRec", Log::ERR, "Failed to get end block");
+    logger->error(TAG, "Failed to get end block");
     if (!vdr->isConnected()) doConnectionLost();    
     return false;
   }
@@ -127,7 +129,7 @@ bool PlayerRadioRec::setLengthSeconds()
   free(buffer);
   if (!success)
   {
-    logger->log("PlayerRadioRec", Log::ERR, "Failed to get end PTS");
+    logger->error(TAG, "Failed to get end PTS");
     return false;
   }
 
@@ -208,7 +210,7 @@ void PlayerRadioRec::stop()
   if (!initted) return;
   if (state == S_STOP) return;
   stateLock.lock();
-  logger->log("PlayerRadioRec", Log::DEBUG, "Stop called lock");
+  logger->debug(TAG, "Stop called lock");
   switchState(S_STOP);
   stateLock.unlock();
 }
@@ -229,7 +231,7 @@ void PlayerRadioRec::pause()
 void PlayerRadioRec::jumpToPercent(double percent)
 {
   stateLock.lock();
-  logger->log("PlayerRadioRec", Log::DEBUG, "JUMP TO %i%%", percent);
+  logger->debug(TAG, "JUMP TO {}%", percent);
   ULONG newFrame = static_cast<ULONG>(percent * lengthFrames / 100);
   switchState(S_JUMP, newFrame);
   stateLock.unlock();
@@ -238,7 +240,7 @@ void PlayerRadioRec::jumpToPercent(double percent)
 void PlayerRadioRec::skipForward(UINT seconds)
 {
   std::lock_guard<std::mutex> lg(stateLock);
-  logger->log("PlayerRadioRec", Log::DEBUG, "SKIP FORWARD %i SECONDS", seconds);
+  logger->debug(TAG, "SKIP FORWARD {} SECONDS", seconds);
   ULONG currentSeconds = getCurrentSeconds();
   ULONG currentFrame = demuxer->getPacketNum();
 
@@ -253,7 +255,7 @@ void PlayerRadioRec::skipForward(UINT seconds)
 void PlayerRadioRec::skipBackward(UINT seconds)
 {
   std::lock_guard<std::mutex> lg(stateLock);
-  logger->log("PlayerRadioRec", Log::DEBUG, "SKIP BACKWARD %i SECONDS", seconds);
+  logger->debug(TAG, "SKIP BACKWARD {} SECONDS", seconds);
   ULONG currentSeconds = getCurrentSeconds();
   ULONG currentFrame = demuxer->getPacketNum();
 
@@ -275,7 +277,7 @@ void PlayerRadioRec::switchState(UCHAR toState, ULONG jumpToFrame)
 {
   if (!initted) return;
 
-  logger->log("PlayerRadioRec", Log::DEBUG, "Switch state from %u to %u", state, toState);
+  logger->debug(TAG, "Switch state from {} to {}", state, toState);
 
   switch(state) // current state selector
   {
@@ -410,7 +412,7 @@ void PlayerRadioRec::restartAtFrame(ULONG newFrame)
 
 void PlayerRadioRec::doConnectionLost()
 {
-  logger->log("PlayerRadioRec", Log::DEBUG, "Connection lost, sending message");
+  logger->debug(TAG, "Connection lost, sending message");
   Message* m = new Message();
   m->to = messageReceiver;
   m->from = this;
@@ -439,7 +441,7 @@ void PlayerRadioRec::threadMethod()
 
   feedPosition = vdr->positionFromFrameNumber(currentFrameNumber);
   if (!vdr->isConnected()) { doConnectionLost(); return; }
-  logger->log("PlayerRadioRec", Log::DEBUG, "startFeedPlay: wantedFrame %i goto %llu", currentFrameNumber, feedPosition);
+  logger->debug(TAG, "startFeedPlay: wantedFrame {} goto {}", currentFrameNumber, feedPosition);
 
 
   Buffer threadBuffer;
@@ -459,12 +461,12 @@ void PlayerRadioRec::threadMethod()
     {
       lengthBytes = vdr->rescanRecording(&lengthFrames);
       if (!vdr->isConnected()) { doConnectionLost(); return; }
-      logger->log("PlayerRadioRec", Log::DEBUG, "Rescanned and reset length: %llu", lengthBytes);
+      logger->debug(TAG, "Rescanned and reset length: {}", lengthBytes);
       lastRescan = time(NULL);
 
       if (!setLengthSeconds())
       {
-        logger->log("PlayerRadioRec", Log::ERR, "Failed to setLengthSeconds in thread");
+        logger->error(TAG, "Failed to setLengthSeconds in thread");
         return;
       }
     }
@@ -501,7 +503,7 @@ void PlayerRadioRec::threadMethod()
     {
       int a_stream = demuxer->scan(threadBuffer.ucharp(), thisRead);
       demuxer->setAudioStream(a_stream);
-      logger->log("PlayerRadioRec", Log::DEBUG, "Startup Audio stream chosen %x", a_stream);
+      logger->debug(TAG, "Startup Audio stream chosen {:#x}", a_stream);
       startup = false;
     }
 
@@ -529,7 +531,7 @@ void PlayerRadioRec::threadMethod()
   }
 
   // end of recording
-  logger->log("PlayerRadioRec", Log::DEBUG, "Recording playback ends");
+  logger->debug(TAG, "Recording playback ends");
 
   if (threadReqQuit) return;
 
@@ -539,6 +541,6 @@ void PlayerRadioRec::threadMethod()
   m->from = this;
   m->message = Message::PLAYER_EVENT;
   m->parameter = PlayerRadioRec::STOP_PLAYBACK;
-  logger->log("PlayerRadioRec", Log::DEBUG, "Posting message to %p...", messageQueue);
+  logger->debug(TAG, "Posting message to {}...", (void*)messageQueue);
   messageQueue->postMessage(m);
 }
index 585a7a10d6748508b7724c578313905b12f76c90..460290f73b2197685799fafd0c922266ca728c1d 100644 (file)
@@ -28,7 +28,7 @@
 #include "callback.h"
 #include "afeed.h"
 
-class Log;
+class LogNT;
 class Audio;
 class Video;
 class Demuxer;
@@ -88,7 +88,7 @@ class PlayerRadioRec : public Callback
 
     MessageQueue* messageQueue;
     void* messageReceiver;
-    Log* logger;
+    LogNT* logger;
     Audio* audio;
     Demuxer* demuxer;
     VDR* vdr;
index 32036fc1e25fd95bf26d9a3c2e56bee55ad3bb94..1fbe3ef3e5a3831905634f02abe6548adb835a3c 100644 (file)
--- a/recman.cc
+++ b/recman.cc
@@ -20,7 +20,7 @@
 #include "recman.h"
 
 #include "vdr.h"
-#include "oldlog.h"
+#include "log.h"
 
 RecMan::RecMan()
 {
@@ -261,6 +261,6 @@ void RecMan::toggleSortOrder()
 
 void RecMan::sort()
 {
-  Log::getInstance()->log("RecMan", Log::DEBUG, "Sort");
+  LogNT::getInstance()->debug("RecMan", "Sort");
   rootDir->sort(chronoSortOrder);
 }
index 240eca60aa5854316cef002f3786da9a68f2cb66..c75dbfd9ea9281b05f09b14f4e13f0fc5e8be654 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 #include "defines.h"
-#include "oldlog.h"
+#include "log.h"
 #include "input.h"
 #include "wsymbol.h"
 #include "colour.h"
@@ -34,7 +34,7 @@
 
 SleepTimer::SleepTimer()
 {
-  logger = Log::getInstance();
+  logger = LogNT::getInstance();
   boxstack = BoxStack::getInstance();
   timers = Timers::getInstance();
 }
@@ -134,7 +134,7 @@ void SleepTimer::timercall(int clientReference)
   {
     if (state == 0) // inactive
     {
-      logger->log("SleepTimer", Log::ERR, "Received timercall when state 0");
+      logger->error("SleepTimer", "Received timercall when state 0");
     }
     else if (state == 1 || state == 2) // counting (either with or without modify display showing)
     {
@@ -188,7 +188,7 @@ void SleepTimer::timercall(int clientReference)
     }
     else if (state == 4) // not counting, off dialogue showing
     {
-      logger->log("SleepTimer", Log::ERR, "Received timercall when state 4");
+      logger->error("SleepTimer", "Received timercall when state 4");
     }
   }
 }
index f548545a557c59f391bebf566f5195e73fb046b1..db3a197a38fe7ee698facee2efac49bd53a5d973 100644 (file)
@@ -27,7 +27,7 @@
 #include "wsymbol.h"
 #include "timers.h"
 
-class Log;
+class LogNT;
 class BoxStack;
 class VSleepTimer;
 class VCountdown;
@@ -41,7 +41,7 @@ class SleepTimer : public TimerReceiver
    void shutdown();
 
  private:
-   Log* logger{};
+   LogNT* logger{};
    BoxStack* boxstack{};
    Timers* timers{};
 
index ba6903e3b16066c99e68cdb2aa13c57dadf7e621..14319bc409603c04f4bb3300f8b813b50493d6b2 100644 (file)
--- a/stream.cc
+++ b/stream.cc
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "oldlog.h"
+//#include "oldlog.h"
 #include "stream.h"
 
 Stream::~Stream()
index 73b74acce1c732226508baf9770f86ecc1e1c26a..85697c79f2da4e70c61584c59caffca2184ae15f 100644 (file)
@@ -20,7 +20,6 @@
 #include <math.h>
 #include <algorithm>
 #include "osd.h"
-#include "oldlog.h"
 #include "video.h"
 
 #include "teletxt/txtfont.h"
index b4532866b5a908fef4f6710b165a187277a1bb5f..857388d78f775eb7f2d08f14dc1fefbc39f23755 100644 (file)
--- a/tbboxx.cc
+++ b/tbboxx.cc
@@ -20,8 +20,6 @@
 
 #include "tbboxx.h"
 
-#include "oldlog.h"
-
 TBBoxx::TBBoxx()
 {
   titleBarOn = 0;
index ce5bdc398694e0f0aed60b542c77cec847b8eff7..f342f4bda4881a5f4340cf25012bcf5495eaf4ff 100644 (file)
--- a/tfeed.cc
+++ b/tfeed.cc
@@ -16,7 +16,6 @@
     along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
 */
 
-#include "oldlog.h"
 #include "demuxer.h"
 #include "callback.h"
 #include "util.h"
index a52663ac888942e60cf1d042f968101f06c2d864..ea6bcacf473aeb46e0e0ef10c9a4e93b66d46f12 100644 (file)
@@ -30,7 +30,7 @@
 #include "message.h"
 #include "messagequeue.h"
 #include "recinfo.h"
-#include "oldlog.h"
+#include "log.h"
 #include "channel.h"
 
 #include "vaudioselector.h"
@@ -40,7 +40,7 @@ VAudioSelector::VAudioSelector(void* tparent, bool* availableMpegAudioChannels,
                                int currentSubtitleChannel, int currentSubtitleType, RecInfo* recInfo)
 : parent(tparent), liveMode(false)
 {
-  Log::getInstance()->log("VAS", Log::DEBUG, "%i", currentAudioChannel);
+  LogNT::getInstance()->debug("VAudioSelector", "{}", currentAudioChannel);
 
   int i;
 
index 02fb88ecf006d9ca3b96ff768b72aa2ea8656654..861413600b1aa76d8019dae4a15770bf46ddcaf3 100644 (file)
     along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
 */
 
-
 #include "input.h"
 #include "message.h"
 #include "boxstack.h"
 #include "colour.h"
-#include "oldlog.h"
 #include "vdr.h"
 #include "messagequeue.h"
 
index eb49266434cf9fdc2dade6f7fc7690fe702cf037..e4e0caafe6d2b98c9ccab428fd6fed8e375e2ed0 100644 (file)
@@ -25,7 +25,7 @@
 #include "i18n.h"
 #include "boxstack.h"
 #include "message.h"
-#include "oldlog.h"
+#include "log.h"
 #include "vdr.h"
 #include "wol.h"
 #include "vserverselect.h"
 
 #include "vconnect.h"
 
+static const char* TAG = "VConnect";
+
 VConnect::VConnect()
 {
   boxstack = BoxStack::getInstance();
   vdr = VDR::getInstance();
-  logger = Log::getInstance();
+  logger = LogNT::getInstance();
 
   setSize(400, 200);
   createBuffer();
@@ -64,7 +66,7 @@ VConnect::~VConnect()
 void VConnect::draw()
 {
   VInfo::draw();
-  logger->log("VConnect", Log::DEBUG, "Draw done");
+  logger->debug(TAG, "Draw done");
 }
 
 int VConnect::handleCommand(int /* command */)
@@ -97,7 +99,7 @@ void VConnect::stop()
 
 void VConnect::threadMethod()
 {
-  logger->log("VConnect", Log::DEBUG, "start threadMethod");
+  logger->debug(TAG, "start threadMethod");
 
   ULONG delay = 0;
   int success;
@@ -109,7 +111,7 @@ void VConnect::threadMethod()
 
   if (!vdpc.init())
   {
-    logger->log("VConnect", Log::CRIT, "Failed to init VDPC");
+    logger->crit(TAG, "Failed to init VDPC");
     return;
   }
 
@@ -130,7 +132,7 @@ void VConnect::threadMethod()
     }
 
     for (ULONG i = 0; i < vdpc.numServers(); i++)
-      logger->log("VConnect", Log::INFO, "Found server: %i %s %s %u", vdpc[i].ipVersion, vdpc[i].ip.c_str(), vdpc[i].name.c_str(), vdpc[i].port, vdpc[i].version);
+      logger->info(TAG, "Found server: {} {} {} {}", vdpc[i].ipVersion, vdpc[i].ip.c_str(), vdpc[i].name.c_str(), vdpc[i].port, vdpc[i].version);
 
     if (vdpc.numServers() == 1)
     {
@@ -152,7 +154,7 @@ void VConnect::threadMethod()
 
     if (threadReqQuit) return;
 
-    logger->log("VConnect", Log::NOTICE, "Connecting to server at %s %u", vdpc[selectedServer].ip.c_str(), vdpc[selectedServer].port);
+    logger->info(TAG, "Connecting to server at {} {}", vdpc[selectedServer].ip.c_str(), vdpc[selectedServer].port);
     Wol::getInstance()->setWakeUpIP(vdpc[selectedServer].ip.c_str());
     vdr->setServerIP(vdpc[selectedServer].ip.c_str());
     vdr->setServerPort(vdpc[selectedServer].port);
@@ -167,7 +169,7 @@ void VConnect::threadMethod()
 
     if (success)
     {
-      logger->log("VConnect", Log::DEBUG, "Connected ok, doing login");
+      logger->debug(TAG, "Connected ok, doing login");
       unsigned int version_server_min, version_server_max, version_client;
       int subtitles;
       success = vdr->doLogin(&version_server_min, &version_server_max, &version_client, Control::getInstance()->getASLList(), subtitles);
@@ -199,7 +201,7 @@ void VConnect::threadMethod()
     if (threadReqQuit) return;
   } while(!success);
 
-  logger->log("VConnect", Log::INFO, "Send VDR connected message");
+  logger->info(TAG, "Send VDR connected message");
   Message* m = new Message(); // Must be done after this thread ends
   m->from = this;
   m->p_to = Message::CONTROL;
index 25580291c9358cbc05cd2316c208fa4a4ee2c33d..32970b7d0caa59c210aa4b130490cd4620b7a67e 100644 (file)
@@ -27,7 +27,7 @@
 #include "vinfo.h"
 #include "vdpc.h"
 
-class Log;
+class LogNT;
 class BoxStack;
 class Message;
 
@@ -45,7 +45,7 @@ class VConnect : public VInfo
 
   private:
     BoxStack* boxstack;
-    Log* logger;
+    LogNT* logger;
     VDPC vdpc;
     VDR* vdr;
 
diff --git a/vdr.h b/vdr.h
index 1d9c941465d413423fb9030cb169ee864ad21b13..363edc1274fc79b88b8da08058f840533b441136 100644 (file)
--- a/vdr.h
+++ b/vdr.h
@@ -33,6 +33,7 @@
 #include <mutex>
 
 #include "defines.h"
+#include "log.h"
 #include "rectimer.h"
 #include "mark.h"
 #ifdef VOMP_MEDIAPLAYER
@@ -40,7 +41,6 @@
 #endif
 #include "eventdispatcher.h"
 #include "i18n.h"
-#include "oldlog.h"
 #include "control.h"
 #include "tcp.h"
 
diff --git a/vepg.cc b/vepg.cc
index 4bf7c8dc86744bd7af17772fb9e3e1dfbcd27058..d6440eba56c0f22393c34e8dded20f64adb79dcb 100644 (file)
--- a/vepg.cc
+++ b/vepg.cc
 #include "boxstack.h"
 #include "channel.h"
 #include "i18n.h"
-#include "oldlog.h"
+#include "log.h"
 
 #include "vepg.h"
 
+static const char* TAG = "VEpg";
+
 VEpg* VEpg::instance = NULL;
 
 VEpg::VEpg(void* tparent, UINT tcurrentChannelIndex, ChannelList* tchanList)
@@ -362,12 +364,12 @@ int VEpg::handleCommand(int command)
     }
     case Input::DOWN:
     { // cursor down the channel list
-      Log::getInstance()->log("VEPG", Log::DEBUG, "Down start");
+      LogNT::getInstance()->debug(TAG, "Down start");
       
       chanListbox.down();
       drawData();
       boxstack->update(this);
-      Log::getInstance()->log("VEPG", Log::DEBUG, "Down end");
+      LogNT::getInstance()->debug(TAG, "Down end");
 
       return 2;
     }
@@ -421,7 +423,7 @@ int VEpg::handleCommand(int command)
     case Input::RECORD:
     {
       if (!chanList) return 2;
-      Log::getInstance()->log("VEPG", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s", thisEvent.id, thisEvent.time, thisEvent.duration, thisEvent.title);
+      LogNT::getInstance()->debug(TAG, "ID {} TIME {} DURATION {} TITLE {}", thisEvent.id, thisEvent.time, thisEvent.duration, thisEvent.title);
       VEpgSetTimer* vs = new VEpgSetTimer(&thisEvent, (*chanList)[chanListbox.getCurrentOption()]);
       vs->draw();
       boxstack->add(vs);
index 70b95059319c6f9ca46379521f5fdbef26df7b89..a5dc8efb97c6fc4f2c476056bba73dc0a08acda6 100644 (file)
@@ -28,7 +28,7 @@
 #include "video.h"
 #include "i18n.h"
 #include "messagequeue.h"
-#include "oldlog.h"
+#include "log.h"
 #include "movieinfo.h"
 #include "seriesinfo.h"
 #include "event.h"
@@ -40,6 +40,8 @@
 
 #include "vepglistadvanced.h"
 
+static const char* TAG = "VEpgListAdvanced";
+
 VEpgListAdvanced::VEpgListAdvanced(VVideoLiveTV* tvideolive, ChannelList* tchanList, ULONG initialChannelNumber)
 {
   channelNumber = initialChannelNumber;
@@ -219,7 +221,7 @@ void VEpgListAdvanced::doBlue()
 
 void VEpgListAdvanced::doNext()
 {
-  Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "doNext");
+  LogNT::getInstance()->debug(TAG, "doNext");
   ULONG slCurrentOption = reinterpret_cast<ULONG>(sl.getCurrentOptionData());
 
   if (mode != OneChannel)
@@ -240,7 +242,7 @@ void VEpgListAdvanced::doNext()
 
 void VEpgListAdvanced::doNow()
 {
-  Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "doNow");
+  LogNT::getInstance()->debug(TAG, "doNow");
   ULONG slCurrentOption = reinterpret_cast<ULONG>(sl.getCurrentOptionData());
 
   if (mode != OneChannel)
@@ -261,7 +263,7 @@ void VEpgListAdvanced::doNow()
 
 void VEpgListAdvanced::doProgramm()
 {
-  Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "doProgram");
+  LogNT::getInstance()->debug(TAG, "doProgram");
   mode = OneChannel;
   ULONG slCurrentOption = reinterpret_cast<ULONG>(sl.getCurrentOptionData());
   Channel* chan = (*chanList)[slCurrentOption];
@@ -287,7 +289,7 @@ void VEpgListAdvanced::doSwitch()
       channelNumber = chan->number;
     }
 
-    Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "doSwitch %d", channelNumber);
+    LogNT::getInstance()->debug(TAG, "doSwitch {}", channelNumber);
     Message* m = new Message(); // Must be done after this view deleted
     m->from = this;
     m->to = videolive;
@@ -310,7 +312,7 @@ void VEpgListAdvanced::doRecord()
 
   if (current)
   {
-    Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "Found the option you pointed at. %s %d", current->title, current->id);
+    LogNT::getInstance()->debug(TAG, "Found the option you pointed at. {} {}", current->title, current->id);
     unsigned int chanlistsize = chanList->size();
     Channel* chan;
     UINT listIndex;
@@ -322,7 +324,7 @@ void VEpgListAdvanced::doRecord()
       if (chan->number == channel) break;
     }
 
-    Log::getInstance()->log("VEpgSummary", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s",
+    LogNT::getInstance()->debug(TAG, "ID {} TIME {} DURATION {} TITLE {}",
                             current->id, current->time, current->duration, current->title);
     VEpgSetTimer* vs = new VEpgSetTimer(current, chan);
     vs->draw();
@@ -462,7 +464,7 @@ void VEpgListAdvanced::updateEpgDataChannel()
   time_t now;
   time(&now);
   eventLista[0] = VDR::getInstance()->getChannelSchedule(channelNumber, now, 24 * 60 * 60 * 30); // one month
-  Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "Eventlist %x %d", eventLista[0], channelNumber);
+  LogNT::getInstance()->debug(TAG, "Eventlist {:#x} {}", (void*)eventLista[0], channelNumber);
 }
 
 void VEpgListAdvanced::drawData(bool doIndexPop)
@@ -508,7 +510,7 @@ void VEpgListAdvanced::drawDataChannel(bool doIndexPop)
       strftime(tempB, 300, "- %H:%M ", &btime);
       int check = SNPRINTF(tempC, 300, "\t %s\n \t \t%s%s", currentEvent->title.c_str(), tempA, tempB);
 
-      if ((check < 0) || (check > 299)) Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "String too big");
+      if ((check < 0) || (check > 299)) LogNT::getInstance()->debug(TAG, "String too big");
 
       // New TVMedia stuff
       TVMediaInfo* info = new TVMediaInfo();
@@ -579,7 +581,7 @@ void VEpgListAdvanced::drawDataNowNext(bool next, bool doIndexPop)
       strftime(tempB, 300, "- %H:%M ", &btime);
       int check = SNPRINTF(tempC, 300, "%s\n%s\t %s%s", currentEvent->title.c_str(), chan->name, tempA, tempB);
 
-      if ((check < 0) || (check > 299)) Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "String too big");
+      if ((check < 0) || (check > 299)) LogNT::getInstance()->debug(TAG, "String too big");
     }
     else
     {
@@ -882,7 +884,7 @@ int VEpgListAdvanced::handleCommand(int command)
 
       if (current)
       {
-        Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "Found the option you pointed at. %s %d", current->title.c_str(), current->id);
+        LogNT::getInstance()->debug(TAG, "Found the option you pointed at. {} {}", current->title.c_str(), current->id);
         unsigned int chanlistsize = chanList->size();
         Channel* chan;
         UINT listIndex;
@@ -917,7 +919,7 @@ int VEpgListAdvanced::handleCommand(int command)
 
 void VEpgListAdvanced::processMessage(Message* m)
 {
-  Log::getInstance()->log("VEpgListAdvanced", Log::DEBUG, "Got message value %lu", m->message);
+  LogNT::getInstance()->debug(TAG, "Got message value {}", m->message);
 
   if (m->message == Message::MOUSE_MOVE)
   {
index 3c0241d613590a478b49b95305081d3edba6e8c7..a82f6e4d2d8181a6a6663bd3a391cdd09fb697be 100644 (file)
@@ -23,7 +23,7 @@
 #include "channel.h"
 #include "boxstack.h"
 #include "vdr.h"
-#include "oldlog.h"
+#include "log.h"
 #include "vinfo.h"
 #include "message.h"
 #include "control.h"
 
 #include "vepgsettimer.h"
 
+static const char* TAG = "VEPGST";
+
 VEpgSetTimer::VEpgSetTimer(Event* tevent, Channel* tchannel)
 {
   boxstack = BoxStack::getInstance();
   vdr = VDR::getInstance();
-  logger = Log::getInstance();
+  logger = LogNT::getInstance();
 
   event = tevent;
   channel = tchannel;
@@ -70,10 +72,10 @@ VEpgSetTimer::VEpgSetTimer(Event* tevent, Channel* tchannel)
   buttonYes.setActive(1);
   selectedOption = YES;
 
-  logger->log("VEPGST", Log::DEBUG, "Title: %s", event->title);
-  logger->log("VEPGST", Log::DEBUG, "Time: %lu", event->time);
-  logger->log("VEPGST", Log::DEBUG, "Duration: %lu", event->duration);
-  logger->log("VEPGST", Log::DEBUG, "Channel: %i", channel->number);
+  logger->debug(TAG, "Title: {}", event->title);
+  logger->debug(TAG, "Time: {}", event->time);
+  logger->debug(TAG, "Duration: {}", event->duration);
+  logger->debug(TAG, "Channel: {}", channel->number);
 }
 
 VEpgSetTimer::~VEpgSetTimer()
@@ -244,7 +246,7 @@ int VEpgSetTimer::handleCommand(int command)
 void VEpgSetTimer::doit()
 {
   char* timerString = genTimerString();
-  logger->log("VEPGST", Log::DEBUG, "%s", timerString);
+  logger->debug(TAG, "{}", timerString);
 
   ULONG ret = vdr->setEventTimer(timerString);
   delete[] timerString;
@@ -254,9 +256,9 @@ void VEpgSetTimer::doit()
     Control::getInstance()->connectionLost();
   }
 
-  if (ret == 0) logger->log("VEPGST", Log::DEBUG, "Success");
-  else if (ret == 1) logger->log("VEPGST", Log::DEBUG, "Fail: Timer already set for this event");
-  else if (ret == 2) logger->log("VEPGST", Log::DEBUG, "Fail: General failure setting timer");
+  if (ret == 0) logger->debug(TAG, "Success");
+  else if (ret == 1) logger->debug(TAG, "Fail: Timer already set for this event");
+  else if (ret == 2) logger->debug(TAG, "Fail: General failure setting timer");
 
   VInfo* vi = new VInfo();
   vi->setSize(400, 150);
index 943f27f9eeb5fdefc60bdc17a9f28b83d2ddac55..3cf7fff27e44e265f2cdc22de017e71fdb27f744 100644 (file)
@@ -25,7 +25,7 @@
 
 class Event;
 class Channel;
-class Log;
+class LogNT;
 class VDR;
 class Message;
 class BoxStack;
@@ -42,7 +42,7 @@ class VEpgSetTimer : public TBBoxx
 
   private:
     BoxStack* boxstack;
-    Log* logger;
+    LogNT* logger;
     VDR* vdr;
 
     Event* event;
index 7cafc7176fbcabb7a155d5d7206c0466db4ca09f..6a4589f3c7138a209fb40b1e7ce595b1fa72ba9b 100644 (file)
--- a/vopts.cc
+++ b/vopts.cc
@@ -27,7 +27,7 @@
 #include "boxstack.h"
 #include "woptionpane.h"
 #include "wremoteconfig.h"
-#include "oldlog.h"
+#include "log.h"
 #include "option.h"
 #include "vdr.h"
 #include "messagequeue.h"
@@ -41,6 +41,8 @@
 
 #include "vopts.h"
 
+static const char* TAG = "VOpts";
+
 VOpts::VOpts()
 {
   setTitleBarOn(1);
@@ -332,7 +334,7 @@ void VOpts::doSave()
   {
     if (options[i]->configChoice == options[i]->userSetChoice) continue; // no change
 
-    Log::getInstance()->log("Options", Log::DEBUG, "Option %i has changed", i);
+    LogNT::getInstance()->debug(TAG, "Option {} has changed", i);
 
     // Save to vdr
 
@@ -372,22 +374,22 @@ void VOpts::doSave()
         {
                if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "RGB+composite")==0)
                {
-                       Log::getInstance()->log("Options", Log::DEBUG, "Setting RGB/Composite");
+                       LogNT::getInstance()->debug(TAG, "Setting RGB/Composite");
                        Video::getInstance()->setConnection(Video::COMPOSITERGB);
                }
                else  if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "S-Video")==0)
                {
-                       Log::getInstance()->log("Options", Log::DEBUG, "Setting S-Video");
+                       LogNT::getInstance()->debug(TAG, "Setting S-Video");
                        Video::getInstance()->setConnection(Video::SVIDEO);
                }
                else  if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "HDMI")==0)
                {
-                       Log::getInstance()->log("Options", Log::DEBUG, "Setting HDMI");
+                       LogNT::getInstance()->debug(TAG, "Setting HDMI");
                        Video::getInstance()->setConnection(Video::HDMI);
                }
                else  if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "HDMI3D")==0)
                {
-                       Log::getInstance()->log("Options", Log::DEBUG, "Setting HDMI");
+                       LogNT::getInstance()->debug(TAG, "Setting HDMI");
                        Video::getInstance()->setConnection(Video::HDMI3D);
                }
                break;
@@ -396,17 +398,17 @@ void VOpts::doSave()
         {
           if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "16:9")==0)
           {
-            Log::getInstance()->log("Options", Log::DEBUG, "Setting 16:9 TV");
+            LogNT::getInstance()->debug(TAG, "Setting 16:9 TV");
             Video::getInstance()->setTVsize(Video::ASPECT16X9);
           }
           else  if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "4:3")==0)
           {
-            Log::getInstance()->log("Options", Log::DEBUG, "Setting 4:3 TV");
+            LogNT::getInstance()->debug(TAG, "Setting 4:3 TV");
             Video::getInstance()->setTVsize(Video::ASPECT4X3);
           }
           else  if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "14:9")==0)
           {
-                 Log::getInstance()->log("Options", Log::DEBUG, "Setting 14:9 TV");
+                 LogNT::getInstance()->debug(TAG, "Setting 14:9 TV");
                  Video::getInstance()->setTVsize(Video::ASPECT14X9);
           }
           break;
@@ -415,12 +417,12 @@ void VOpts::doSave()
         {
           if (options[i]->userSetChoice == 1)
           {
-            Log::getInstance()->log("Options", Log::DEBUG, "Setting letterbox");
+            LogNT::getInstance()->debug(TAG, "Setting letterbox");
             Video::getInstance()->setMode(Video::LETTERBOX);
           }
           else
           {
-            Log::getInstance()->log("Options", Log::DEBUG, "Setting chop-sides");
+            LogNT::getInstance()->debug(TAG, "Setting chop-sides");
             Video::getInstance()->setMode(Video::NORMAL);
           }
           break;
@@ -436,7 +438,7 @@ void VOpts::doSave()
           else if (options[i]->userSetChoice == 5) newTCPsize = 16384;
           else if (options[i]->userSetChoice == 6) newTCPsize = 32768;
           else if (options[i]->userSetChoice == 7) newTCPsize = 65536;
-          Log::getInstance()->log("Options", Log::DEBUG, "Setting TCP window size %i", newTCPsize);
+          LogNT::getInstance()->debug(TAG, "Setting TCP window size {}", newTCPsize);
           VDR::getInstance()->setReceiveWindow(newTCPsize);
           break;
         }
@@ -449,12 +451,12 @@ void VOpts::doSave()
         {
           if (options[i]->userSetChoice == 1)
           {
-            Log::getInstance()->log("Options", Log::DEBUG, "Setting automatic vdr shutdown");
+            LogNT::getInstance()->debug(TAG, "Setting automatic vdr shutdown");
             VDR::getInstance()->setVDRShutdown(true);
           }
           else
           {
-            Log::getInstance()->log("Options", Log::DEBUG, "Setting local shutdown");
+            LogNT::getInstance()->debug(TAG, "Setting local shutdown");
             VDR::getInstance()->setVDRShutdown(false);
           }
           break;
@@ -463,12 +465,12 @@ void VOpts::doSave()
         {
                if (options[i]->userSetChoice == 1)
                {
-                       Log::getInstance()->log("Options", Log::DEBUG, "Setting classic menu");
+                       LogNT::getInstance()->debug(TAG, "Setting classic menu");
                        Control::getInstance()->setAdvMenus(false);
                }
                else
                {
-                       Log::getInstance()->log("Options", Log::DEBUG, "Setting advanced menu");
+                       LogNT::getInstance()->debug(TAG, "Setting advanced menu");
                        Control::getInstance()->setAdvMenus(true);
                }
                break;
@@ -476,7 +478,7 @@ void VOpts::doSave()
         case 20:
         {
                SkinFactory::InitSkin(options[i]->userSetChoice);
-               Log::getInstance()->log("Options", Log::DEBUG, "Init Skin %d",options[i]->userSetChoice);
+               LogNT::getInstance()->debug(TAG, "Init Skin {}", options[i]->userSetChoice);
                break;
         }
       }
index 60bde94dc9aae3302b0c627338d03b75e059eceb..0fd242530029f9fdd1a888c048c3b4821aacc6cd 100644 (file)
@@ -27,7 +27,7 @@
 #include "vinfo.h"
 #include "boxstack.h"
 #include "i18n.h"
-#include "oldlog.h"
+#include "log.h"
 
 VPictureBanner::VPictureBanner(bool ld, bool sl)
 {
@@ -39,7 +39,7 @@ VPictureBanner::VPictureBanner(bool ld, bool sl)
   setPosition(50, v->getScreenHeight()-50);
   setTitleBarOn(0);
   info=NULL;
-  Log::getInstance()->log("VPictureBanner",Log::DEBUG,"created %p",this);
+  LogNT::getInstance()->debug("VPictureBanner", "created {}", (void*)this);
   //TODO compute sizes from text
   rotsize=70;
   infsize=50;
@@ -47,7 +47,7 @@ VPictureBanner::VPictureBanner(bool ld, bool sl)
 
 VPictureBanner::~VPictureBanner()
 {
-  Log::getInstance()->log("VPictureBanner",Log::DEBUG,"deleted %p",this);
+  LogNT::getInstance()->debug("VPictureBanner", "deleted {}", (void*)this);
 }
 
 
index 9b24980742f1d7a2044d5a3a59000c580794cdcf..72f2e17d77eebbfc859cbe094e5bb931a7d78eb3 100644 (file)
@@ -428,8 +428,8 @@ void VRadioRec::timercall(int clientReference)
 
 void VRadioRec::drawBarClocks()
 {
-  Log* logger = Log::getInstance();
-  LogNT::getInstance()->debug(TAG, "Draw bar clocks");
+  LogNT* logger = LogNT::getInstance();
+  logger->debug(TAG, "Draw bar clocks");
 
   // Draw RTC
   // Blank the area first
index 90cf8b3d6c77c4c32e9bc99c67a6d1d0fefb808e..e30dcd736b4143607a1fc7408db3db0f6bbae1c3 100644 (file)
 #include "vrecordinglist.h"
 #include "recording.h"
 #include "message.h"
-#include "oldlog.h"
+#include "log.h"
 #include "wmovieview.h"
 #include "wseriesview.h"
 #include "wpictureview.h"
 
+static const char* TAG = "VRecording";
+
 VRecording::VRecording(RecMan* trecman, Recording* trec)
 {
   rec = trec;
@@ -46,9 +48,9 @@ VRecording::VRecording(RecMan* trecman, Recording* trec)
   buttons = true;
   selected = RESUME;
   
-  Log::getInstance()->log("VRecording", Log::DEBUG, "%s", rec->getProgName());
+  LogNT::getInstance()->debug(TAG, "{}", rec->getProgName());
   rec->loadRecInfo();
-  Log::getInstance()->log("VRecording", Log::DEBUG, "%s", rec->getProgName());
+  LogNT::getInstance()->debug(TAG, "{}", rec->getProgName());
 
 
   if (Video::getInstance()->getFormat() == Video::PAL)
index 5ed781923cd409c9e4467297bbd0485db24667fc..7f3c1a4abee7ba5b7c92a7f86f78c236c1bfced3 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "vrecordinglist.h"
 
+#include "log.h"
 #include "recman.h"
 #include "directory.h"
 #include "recording.h"
@@ -35,7 +36,8 @@
 #include "i18n.h"
 #include "control.h"
 #include "vinfo.h"
-#include "oldlog.h"
+
+static const char* TAG = "VRecordingList";
 
 VRecordingList::VRecordingList()
 {
@@ -52,7 +54,7 @@ VRecordingList::~VRecordingList()
 
 void VRecordingList::processMessage(Message* m)
 {
-  Log::getInstance()->log("VRecordingList", Log::DEBUG, "Got message value %lu", m->message);
+  LogNT::getInstance()->debug(TAG, "Got message value {}", m->message);
 
   if (m->message == Message::MOUSE_MOVE)
   {
@@ -75,12 +77,12 @@ void VRecordingList::processMessage(Message* m)
   }
   else if (m->message == Message::DELETE_SELECTED_RECORDING)
   {
-    Log::getInstance()->log("VRecordingList", Log::DEBUG, "Doing delete selected");
+    LogNT::getInstance()->debug(TAG, "Doing delete selected");
     doDeleteSelected();
   }
   else if (m->message == Message::MOVE_RECORDING)
   {
-    Log::getInstance()->log("VRecordingList", Log::DEBUG, "Doing move recording");
+    LogNT::getInstance()->debug(TAG, "Doing move recording");
     doMoveRecording(reinterpret_cast<Directory*>(m->parameter));
   }
   else if (m->message == Message::PLAY_SELECTED_RECORDING)
@@ -104,7 +106,7 @@ void VRecordingList::doDeleteSelected()
 
   if (!toDelete) return;
 
-  Log::getInstance()->log("VRecordingList", Log::DEBUG, "FOUND: %i %s %s", toDelete->index, toDelete->getProgName(), toDelete->getFileName());
+  LogNT::getInstance()->debug(TAG, "FOUND: {} {} {}", toDelete->index, toDelete->getProgName(), toDelete->getFileName());
 
   int success = recman->deleteRecording(toDelete);
   if (!VDR::getInstance()->isConnected())
@@ -144,7 +146,7 @@ void VRecordingList::doMoveRecording(Directory* toDir)
   Recording* toMove = getCurrentOptionRecording();
   if (!toMove || !toDir) return;
 
-  Log::getInstance()->log("VRecordingList", Log::DEBUG, "MOVE: %s %s", toMove->getProgName(), toDir->name);
+  LogNT::getInstance()->debug(TAG, "MOVE: {} {}", toMove->getProgName(), toDir->name);
 
   int success = recman->moveRecording(toMove, toDir);
   if (!VDR::getInstance()->isConnected())
@@ -371,7 +373,7 @@ int VRecordingList::handleCommand(int command)
       Recording* current = getCurrentOptionRecording();
       if (current)
       {
-        Log::getInstance()->log("VRecordingList", Log::DEBUG, "Found the option you pointed at. %s %s", current->getProgName(), current->getFileName());
+        LogNT::getInstance()->debug(TAG, "Found the option you pointed at. {} {}", current->getProgName(), current->getFileName());
 
 /*
         VRecordingMenu* v = new VRecordingMenu(recman);
index bc85a4103a9de2f298863e8b383814c072a724bd..5b10daa0345cbd26475bdb37c36c55203dbcd8b7 100644 (file)
@@ -37,7 +37,7 @@
 #include "i18n.h"
 #include "control.h"
 #include "vinfo.h"
-#include "oldlog.h"
+#include "log.h"
 #include "movieinfo.h"
 #include "seriesinfo.h"
 #include "staticartwork.h"
@@ -129,7 +129,7 @@ void VRecordingListAdvanced::drawData(bool doIndexPop)
     LOCALTIME_R(&recStartTime, &btime);
     strftime(tempA, 299, "%d/%m/%y %H:%M ", &btime);
     int check = SNPRINTF(tempB, 300, "%c\t%s\n \t%s",  (currentRec->getNew() ? '*': ' '), currentRec->getProgName(), tempA);
-    if ((check < 0) || (check > 299)) Log::getInstance()->log("VRecordingsListAdvanced", Log::ERR, "String too big");
+    if ((check < 0) || (check > 299)) LogNT::getInstance()->error("VRecordingsListAdvanced", "String too big");
 
     // New TVMedia stuff
     TVMediaInfo *info= new TVMediaInfo();
index 8e46d78eb0a501b5732f6421963f6e4e89b6610f..c43e626ee988f0f81de5b44f4fc41269546946d8 100644 (file)
@@ -33,7 +33,7 @@
 #include "i18n.h"
 #include "control.h"
 #include "vinfo.h"
-#include "oldlog.h"
+#include "log.h"
 
 #include "vrecordinglistclassic.h"
 
@@ -99,7 +99,7 @@ void VRecordingListClassic::drawData(bool doIndexPop)
     LOCALTIME_R(&recStartTime, &btime);
     strftime(tempA, 300, "%d/%m %H:%M ", &btime);
     int check = SNPRINTF(tempB, 300, "%s\t%c\t%s", tempA, (currentRec->getNew() ? '*': ' '), currentRec->getProgName());
-    if ((check < 0) || (check > 299)) Log::getInstance()->log("VRecordingListClassic", Log::ERR, "String too big");
+    if ((check < 0) || (check > 299)) LogNT::getInstance()->error("VRecordingListClassic", "String too big");
       
     currentRec->index = sl.addOption(tempB, 0, first);
     first = 0;
index 523dc8e78ea115195c86ca82aaba03f034074abf..b290b107b539107c32e1fbd3a1c5c8b1d27883b9 100644 (file)
@@ -22,7 +22,6 @@
 #include <math.h>
 
 #include "defines.h"
-#include "oldlog.h"
 #include "input.h"
 #include "colour.h"
 #include "video.h"
index b45d19bf8d03d3edc8c917673909a78df60ed61d..6b297f85732cd966137c7a15c41061df148adfbf 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <math.h>
 
+#include "log.h"
 #include "video.h"
 #include "boxstack.h"
 #include "input.h"
@@ -52,7 +53,7 @@ VTeletextView::VTeletextView(TeletextDecoderVBIEBU* TTdecoder, Boxx* playerview,
 
 VTeletextView::~VTeletextView()
 {
-  Log::getInstance()->log("VTeletextView", Log::DEBUG, "VTeletextView destruct");
+  LogNT::getInstance()->debug("VTeletextView", "destruct");
   pv->draw();
   BoxStack::getInstance()->update(pv);
   ttdecoder->unRegisterTeletextView(this);
@@ -60,7 +61,7 @@ VTeletextView::~VTeletextView()
 
 void VTeletextView::draw(bool completedraw, bool onlyfirstline)
 {
-  //Log::getInstance()->log("VTeletextView", Log::ERR, "Start draw");
+  LogNT::getInstance()->error("VTeletextView", "Start draw");
   Boxx::draw();
   int x, y;
     
@@ -92,10 +93,10 @@ void VTeletextView::draw(bool completedraw, bool onlyfirstline)
         ttdecoder->setChar(x, y, c);
       }
     }
-//    Log::getInstance()->log("VTeletextView", Log::ERR, "Line %d",y);
+//    LogNT::getInstance()->error("VTeletextView", "Line {}", y);
     if (onlyfirstline) break;
   }
-  //  Log::getInstance()->log("VTeletextView", Log::ERR, "Start end");
+  //  LogNT::getInstance()->error("VTeletextView", "Start end");
 }
 
 int VTeletextView::handleCommand(int command)
index 4be53ca900f9c51b643bbcb83c2abb5deca60c1a..e2dbd00ff4af27cba2eebaa2b76948e0e4ea8bdb 100644 (file)
 #include "control.h"
 #include "boxstack.h"
 #include "vinfo.h"
-#include "oldlog.h"
+#include "log.h"
 #include "staticartwork.h"
 
 #include "vtimerlist.h"
 
+static const char* TAG = "VTimerList";
+
 VTimerList::VTimerList()
 {
   clockRegion.x = 420;
@@ -150,7 +152,7 @@ bool VTimerList::load()
     LOCALTIME_R(&rectime, &btime);
     strftime(strA, 299, "%d/%m %H:%M ", &btime);
     int check = SNPRINTF(strB, 300, "%s\t%s", strA, recTimer->getName());
-    if ((check < 0) || (check > 299)) Log::getInstance()->log("VTimerList", Log::ERR, "String too big");
+    if ((check < 0) || (check > 299)) LogNT::getInstance()->error(TAG, "String too big");
     sl.addOption(strB, recTimer, first);
     first = 0;
   }
@@ -338,12 +340,12 @@ void VTimerList::processMessage(Message* m)
   {
     RecTimer* recTimer = reinterpret_cast<RecTimer*>(sl.getCurrentOptionData());
     if (recTimer == NULL) return;
-    Log::getInstance()->log("VTimerList", Log::DEBUG, "Got timer to delete");
+    LogNT::getInstance()->debug(TAG, "Got timer to delete");
 
   
     ULONG retval = VDR::getInstance()->deleteTimer(recTimer);
     if (!VDR::getInstance()->isConnected()) { Control::getInstance()->connectionLost(); return; }
-    Log::getInstance()->log("VTimerList", Log::DEBUG, "Got return fron delete timer: %lu", retval);
+    LogNT::getInstance()->debug(TAG, "Got return fron delete timer: {}", retval);
     
     if (retval != 10)
     {
index 63b9b8d2a71cd19c23999bc9df7b1093ec738485..a626d28b5090f0e99aed661fdbf4313e84163e21 100644 (file)
 #include "i18n.h"
 #include "bitmap.h"
 #include "recinfo.h"
-#include "oldlog.h"
+#include "log.h"
 #include "channel.h"
 #include "vteletextview.h"
 #include "messagequeue.h"
 
 #include "vvideorec.h"
 
+static const char* TAG = "VVideoRec";
+
 VVideoRec::VVideoRec(Recording* rec, bool ish264)
 {
   boxstack = BoxStack::getInstance();
@@ -81,7 +83,7 @@ VVideoRec::VVideoRec(Recording* rec, bool ish264)
     delete[] cendMargin;
   }
 
-  Log::getInstance()->log("VVideoRec", Log::DEBUG, "SM: %u EM: %u", startMargin, endMargin);
+  LogNT::getInstance()->debug(TAG, "SM: {} EM: {}", startMargin, endMargin);
 
   setSize(video->getScreenWidth(), video->getScreenHeight());
   createBuffer();
@@ -136,7 +138,7 @@ void VVideoRec::preDelete()
 
 VVideoRec::~VVideoRec()
 {
-  Log::getInstance()->log("VVideoRec", Log::DEBUG, "Entering vvideorec destructor");
+  LogNT::getInstance()->debug(TAG, "Entering vvideorec destructor");
 
   video->setDefaultAspect();
 
@@ -160,7 +162,7 @@ void VVideoRec::go(bool resume)
   else
     startFrameNum = 0;
 
-  Log::getInstance()->log("VVideoRec", Log::DEBUG, "Starting stream: %s at frame: %lu", myRec->getFileName(), startFrameNum);
+  LogNT::getInstance()->debug(TAG, "Starting stream: {} at frame: {}", myRec->getFileName(), startFrameNum);
   ULONG lengthFrames = 0;
   bool isPesRecording;
   ULLONG lengthBytes = vdr->streamRecording(myRec->getFileName(), &lengthFrames, &isPesRecording);
@@ -296,14 +298,14 @@ int VVideoRec::handleCommand(int command)
       if (myRec->hasMarks())
       {
         // skip to previous mark
-        Log* logger = Log::getInstance();
+        LogNT* logger = LogNT::getInstance();
         int currentFrame = (player->getCurrentFrameNum()); // get current Frame
         currentFrame -= static_cast<int>(5 * myRec->recInfo->fps); // subtrack 5 seconds, else you cannot skip more than once back ..
 
         int prevMark = myRec->getPrevMark(currentFrame); // find previous Frame
         if (prevMark)
         {
-          logger->log("VVideoRec", Log::NOTICE, "jump back from pos %i to mark at %i",currentFrame,prevMark);
+          logger->info(TAG, "jump back from pos {} to mark at {}",currentFrame,prevMark);
           player->jumpToMark(prevMark);
         }
         doBar(4);
@@ -320,14 +322,14 @@ int VVideoRec::handleCommand(int command)
       if (myRec->hasMarks())
       {
         // skip to next mark
-        Log* logger = Log::getInstance();
+        LogNT* logger = LogNT::getInstance();
         int currentFrame = (player->getCurrentFrameNum());
 
         int nextMark = myRec->getNextMark(currentFrame);
 
         if (nextMark)
         {
-          logger->log("VVideoRec", Log::NOTICE, "jump forward from pos %i to mark at %i",currentFrame,nextMark);
+          logger->info(TAG, "jump forward from pos {} to mark at {}", currentFrame,nextMark);
           player->jumpToMark(nextMark);
         }
         doBar(3);
@@ -442,7 +444,7 @@ void VVideoRec::doTeletext()
 
 void VVideoRec::processMessage(Message* m)
 {
-  Log::getInstance()->log("VVideoRec", Log::DEBUG, "Message received");
+  LogNT::getInstance()->debug(TAG, "Message received");
 
   if (m->message == Message::MOUSE_LBDOWN)
   {
@@ -547,12 +549,12 @@ void VVideoRec::processMessage(Message* m)
   }
   else if (m->message == Message::AUDIO_CHANGE_CHANNEL)
   {
-    Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change audio channel to %i", m->parameter);
+    LogNT::getInstance()->debug(TAG, "Received change audio channel to {}", m->parameter);
     player->setAudioChannel(m->parameter&0xFFFF,(m->parameter&0xFF0000)>> 16,(m->parameter&0xFF000000)>> 24 );
   }
   else if (m->message == Message::SUBTITLE_CHANGE_CHANNEL)
   {
-      Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change subtitle channel to %i", m->parameter);
+      LogNT::getInstance()->debug(TAG, "Received change subtitle channel to {}", m->parameter);
       int type=((m->parameter & 0xFF0000)>>16);
       switch (type) {
       case 0x10: { //dvbsubtitle
@@ -598,20 +600,20 @@ void VVideoRec::processMessage(Message* m)
 
 void VVideoRec::stopPlay()
 {
-  Log::getInstance()->log("VVideoRec", Log::DEBUG, "Pre stopPlay");
+  LogNT::getInstance()->debug(TAG, "Pre stopPlay");
 
   removeBar();
-  Log::getInstance()->log("VVideoRec", Log::DEBUG, "1");
+  LogNT::getInstance()->debug(TAG, "1");
   player->stop();
-  Log::getInstance()->log("VVideoRec", Log::DEBUG, "2");
+  LogNT::getInstance()->debug(TAG, "2");
   vdr->stopStreaming();
-  Log::getInstance()->log("VVideoRec", Log::DEBUG, "3");
+  LogNT::getInstance()->debug(TAG, "3");
   delete player;
 
   playing = false;
 
   if (!vdr->isConnected()) { Control::getInstance()->connectionLost(); return; }
-  Log::getInstance()->log("VVideoRec", Log::DEBUG, "Post stopPlay");
+  LogNT::getInstance()->debug(TAG, "Post stopPlay");
 }
 
 void VVideoRec::toggleChopSides()
@@ -851,7 +853,7 @@ void VVideoRec::doBar(int action_in)
     if (!barGenHold && !barScanHold && !barVasHold)
       timers->setTimerD(this, 1, 4);
 
-    Log::getInstance()->log("VVideoRec", Log::DEBUG, "player state: %i", playerState);
+    LogNT::getInstance()->debug(TAG, "player state: {}", playerState);
 
     if ((playerState == PlayerVideoRec::S_PAUSE_P) || (playerState == PlayerVideoRec::S_PAUSE_I))
       timers->cancelTimer(this, 2);
@@ -904,8 +906,8 @@ void VVideoRec::drawBarClocks()
     }
   }
 
-  Log* logger = Log::getInstance();
-  logger->log("VVideoRec", Log::DEBUG, "Draw bar clocks");
+  LogNT* logger = LogNT::getInstance();
+  logger->debug(TAG, "Draw bar clocks");
 
   // Draw RTC
   // Blank the area first
@@ -949,7 +951,7 @@ void VVideoRec::drawBarClocks()
   else
   {
     SNPRINTF(buffer, 99, "%01i:%02i:%02i / %01i:%02i:%02i", currentFrameHMSF.hours, currentFrameHMSF.minutes, currentFrameHMSF.seconds, lengthHMSF.hours, lengthHMSF.minutes, lengthHMSF.seconds);
-    logger->log("VVideoRec", Log::DEBUG, buffer);
+    logger->debug(TAG, buffer);
   }
 
   drawText(buffer, clocksRegion.x, clocksRegion.y, DrawStyle::LIGHTTEXT);
@@ -977,9 +979,9 @@ void VVideoRec::drawBarClocks()
   {
     int nrWidth = 302 * (lengthFrames - player->getLengthFrames()) / lengthFrames;
 
-    Log::getInstance()->log("GVASDF", Log::DEBUG, "Length Frames: %lu", lengthFrames);
-    Log::getInstance()->log("GVASDF", Log::DEBUG, "Player lf: %lu", player->getLengthFrames());
-    Log::getInstance()->log("GVASDF", Log::DEBUG, "NR WDITH: %i", nrWidth);
+    LogNT::getInstance()->debug("GVASDF", "Length Frames: {}", lengthFrames);
+    LogNT::getInstance()->debug("GVASDF", "Player lf: {}", player->getLengthFrames());
+    LogNT::getInstance()->debug("GVASDF", "NR WDITH: {}", nrWidth);
     rectangle(barRegion.x + progBarXbase + 4 + 302 - nrWidth, barRegion.y + 16, nrWidth, 16, DrawStyle::RED);
   }
 
@@ -998,7 +1000,7 @@ void VVideoRec::drawBarClocks()
       loopMark = *i;
       if (loopMark->pos)
       {
-        logger->log("VVideoRec", Log::DEBUG, "Drawing mark at frame %i", loopMark->pos);
+        logger->debug(TAG, "Drawing mark at frame {}", loopMark->pos);
         posPix = 302 * loopMark->pos / lengthFrames;
         rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 3, 28, DrawStyle::DANGER);
       }
index db16293bc22b2cb91f116e8e3ee8f47c68627ac0..a3bace75ba7ec53df31ecc077de4762f6c88a8c7 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 
-#include "oldlog.h"
+#include "log.h"
 #include "input.h"
 #include "vdr.h"
 #include "vchannellist.h"
index 193a72acb94d1418ace6a744f47374bb1ca124d1..57235bf324676167a4a9c389a2e14e2315ac0ca5 100644 (file)
--- a/wjpeg.cc
+++ b/wjpeg.cc
@@ -30,7 +30,6 @@
 #endif
 
 #include "i18n.h"
-#include "oldlog.h"
 #include "surface.h"
 
 
index 37967bd0b3a8adbeeeee746279bc2a319a3762b7..61b7f5235e3c66a9c912c8cad1c1737d598c83a4 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 
-
-
 #include "i18n.h"
-#include "oldlog.h"
 #include "surface.h"
 
-
-
-
-WJpegSimple::WJpegSimple(){
-
+WJpegSimple::WJpegSimple()
+{
 }
 
-WJpegSimple::~WJpegSimple() {
-
+WJpegSimple::~WJpegSimple()
+{
 }
 
 int WJpegSimple::init(const char* tfileName)
 {
-       fileName=tfileName;
-
+  fileName = tfileName;
   return 1;
 }
 
-
-
-
-
 void WJpegSimple::draw()
 {
-         int width,height;
-         width=height=1;
-         drawJpeg(fileName,0,0,&width,&height);//This should went into the abstract base classes?
-         //Windows has a problem with the leading / fixme
-         setDimensions(width, height);
-
+  int width,height;
+  width=height=1;
+  drawJpeg(fileName,0,0,&width,&height);//This should went into the abstract base classes?
+  //Windows has a problem with the leading / fixme
+  setDimensions(width, height);
 }
-
-
-
-
index 20b4cab070bf44721b2b1294da264e56be661587..fc9f8a37d484d1e136d6547dcb5f93f08a3793bf 100644 (file)
@@ -18,7 +18,6 @@
 */
 
 #include "colour.h"
-#include "oldlog.h"
 #ifndef WIN32
 #include "unistd.h"
 #endif
index 007b45d62f7589dfffb8a74c6a3f48ac9e0e2e62..9cdb79d83e9a08e4992bb383359c8c26293d3518 100644 (file)
@@ -20,7 +20,7 @@
 #include "wtextbox.h"
 #include "i18n.h"
 #include "woptionbox.h"
-#include "oldlog.h"
+#include "log.h"
 #include "vdr.h"
 #include "input.h"
 #include "option.h"
@@ -87,7 +87,7 @@ void WOptionPane::addOptionLine(Option* option)
   {
     for (UINT j = 0; j < option->numChoices; j++)
     {
-      Log::getInstance()->log("Options", Log::DEBUG, "Add option: %s", option->options[j]);
+      LogNT::getInstance()->debug("Options", "Add option: {}", option->options[j]);
       ob->addOption(tr(option->options[j]));
     }
 
index 8f7386c5409951e75f113a1c44c8a18c1c6ab54a..5377d6148ba2673e16d958cbd2741f92b06a98ed 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <string>
 
-#include "oldlog.h"
 #include "input.h"
 #include "inputman.h"
 #include "wsymbol.h"
index 6fe0c4e66e254675cafd726e62718591aa2d56ce..b618e6a000d8432bf55e36d55bd9faf6c8e0db66 100644 (file)
@@ -21,7 +21,6 @@
 #include <string.h>
 
 #include "colour.h"
-#include "oldlog.h"
 
 #include "wselectlist.h"
 
index c28fabb855b68cfc261df09599285cc59b372546..3a1cf114355def0a324babe2b206871a551008bb 100644 (file)
@@ -18,6 +18,7 @@
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
 
+#include "log.h"
 #include "wtabbar.h"
 #include "surface.h"
 #include "input.h"
@@ -179,7 +180,7 @@ int WTabBar::handleCommand(int command)
         }
         else
         {
-          Log::getInstance()->log("WTabBar", Log::ERR, "Up/Down client returned not 1 or 4");
+          LogNT::getInstance()->error("WTabBar", "Up/Down client returned not 1 or 4");
         }
       }
     }