summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthlo <smarttv640@gmail.com>2016-08-14 07:38:27 +0200
committerthlo <smarttv640@gmail.com>2016-08-14 07:38:27 +0200
commit4b82aa28d30ea4935d2099d371ddd3970e713c79 (patch)
tree25253137a090aaea4ec1147d59d90d0f1de6fedc
parent96df8f67303add12a2e016f9c51265f7b5a6f7b7 (diff)
downloadvdr-plugin-smarttvweb-4b82aa28d30ea4935d2099d371ddd3970e713c79.tar.gz
vdr-plugin-smarttvweb-4b82aa28d30ea4935d2099d371ddd3970e713c79.tar.bz2
Announce logfile creation in syslog
-rwxr-xr-xlog.c11
-rwxr-xr-xsmarttvfactory.c4
2 files changed, 9 insertions, 6 deletions
diff --git a/log.c b/log.c
index 96b8126..52dcd97 100755
--- a/log.c
+++ b/log.c
@@ -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();