diff options
author | thlo <smarttv640@gmail.com> | 2016-08-14 07:38:27 +0200 |
---|---|---|
committer | thlo <smarttv640@gmail.com> | 2016-08-14 07:38:27 +0200 |
commit | 4b82aa28d30ea4935d2099d371ddd3970e713c79 (patch) | |
tree | 25253137a090aaea4ec1147d59d90d0f1de6fedc | |
parent | 96df8f67303add12a2e016f9c51265f7b5a6f7b7 (diff) | |
download | vdr-plugin-smarttvweb-4b82aa28d30ea4935d2099d371ddd3970e713c79.tar.gz vdr-plugin-smarttvweb-4b82aa28d30ea4935d2099d371ddd3970e713c79.tar.bz2 |
Announce logfile creation in syslog
-rwxr-xr-x | log.c | 11 | ||||
-rwxr-xr-x | smarttvfactory.c | 4 |
2 files changed, 9 insertions, 6 deletions
@@ -25,6 +25,7 @@ #include <time.h> #include <sys/time.h> #include <cstring> +#include <vdr/tools.h> Log* Log::instance = NULL; @@ -48,13 +49,16 @@ int Log::init(string fileName) { strftime(timebuf, sizeof(timebuf), "%a, %d %b %Y %H:%M:%S (%Z)", localtime(&now)); if (fileName != "") { + esyslog("SmartTvWeb: Creating LogFile: %s", fileName.c_str() ); mLogFile = new ofstream(); mLogFile->open(fileName.c_str(), ios::out); // | ios::app *mLogFile << "Log Created: " << timebuf << endl; } - else + else { + esyslog("SmartTvWeb: Creating LogFile: /dev/null"); mLogFile = new ofstream("/dev/null"); + } return 0; } @@ -65,12 +69,15 @@ int Log::init(char* fileName) { strftime(timebuf, sizeof(timebuf), "%a, %d %b %Y %H:%M:%S GMT", gmtime(&now)); if (strcmp(fileName, "") !=0) { + esyslog("SmartTvWeb: Creating LogFile: %s", fileName); mLogFile = new ofstream(); mLogFile->open(fileName, ios::out ); *mLogFile << "Log Created: " << timebuf << endl; } - else + else { + esyslog("SmartTvWeb: Creating LogFile: /dev/null"); mLogFile = new ofstream("/dev/null"); + } return 0; } diff --git a/smarttvfactory.c b/smarttvfactory.c index cac8330..7c29e8c 100755 --- a/smarttvfactory.c +++ b/smarttvfactory.c @@ -1095,10 +1095,6 @@ void SmartTvServer::initServer(string dir, cSmartTvConfig* cfg) { serverPort = mConfig->getServerPort(); mLog.init(mConfig->getLogFile()); - if (mConfig->getLogFile() != "") { - string msg = "SmartTvWeb: Logfile created File= " + mConfig->getLogFile(); - esyslog("%s", msg.c_str()); - } *(mLog.log()) << mLog.getTimeString() << ": LogFile= " << mConfig->getLogFile() << endl; initRecCmds(); |