summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Wieninger <cwieninger (at) gmx (dot) de>2007-06-04 17:09:45 +0000
committerChristian Wieninger <cwieninger (at) gmx (dot) de>2007-06-04 17:09:45 +0000
commit0ad2091a1c1fbe6586e322ef467db20b86f0bb48 (patch)
tree8ef3cb88add1d9dd1f59a75b878e633c7f074eed
parent29523906a06e4ff526782e6754434fc441e09b9a (diff)
downloadvdr-plugin-live-0ad2091a1c1fbe6586e322ef467db20b86f0bb48.tar.gz
vdr-plugin-live-0ad2091a1c1fbe6586e322ef467db20b86f0bb48.tar.bz2
- additional commandline option: -l level, --log=level log level for tntnet (values:
INFO, DEBUG,...)
-rw-r--r--setup.cpp10
-rw-r--r--setup.h3
-rw-r--r--tntconfig.cpp4
3 files changed, 11 insertions, 6 deletions
diff --git a/setup.cpp b/setup.cpp
index cbd0209..c59f4eb 100644
--- a/setup.cpp
+++ b/setup.cpp
@@ -28,7 +28,8 @@ Setup::Setup():
m_useAuth( 1 ),
m_adminLogin("admin"),
m_theme("marine"),
- m_lastwhatsonlistmode("detail")
+ m_lastwhatsonlistmode("detail"),
+ m_tntnetloglevel("INFO")
{
m_adminPasswordMD5 = "4:" + MD5Hash("live");
liveplugin = cPluginManager::GetPlugin("live");
@@ -39,14 +40,16 @@ bool Setup::ParseCommandLine( int argc, char* argv[] )
static struct option opts[] = {
{ "port", required_argument, NULL, 'p' },
{ "ip", required_argument, NULL, 'i' },
+ { "log", required_argument, NULL, 'l' },
{ 0 }
};
int optchar, optind = 0;
- while ( ( optchar = getopt_long( argc, argv, "p:i:", opts, &optind ) ) != -1 ) {
+ while ( ( optchar = getopt_long( argc, argv, "p:i:l:", opts, &optind ) ) != -1 ) {
switch ( optchar ) {
case 'p': m_serverPort = atoi( optarg ); break;
case 'i': m_serverIps.push_back( optarg ); break;
+ case 'l': m_tntnetloglevel = optarg; break;
default: return false;
}
}
@@ -63,7 +66,8 @@ char const* Setup::CommandLineHelp() const
" (default: " << m_serverPort << ")\n"
<< " -i IP, --ip=IP bind server only to specified IP, may appear\n"
" multiple times\n"
- " (default: 0.0.0.0)\n";
+ " (default: 0.0.0.0)\n"
+ << " -l level, --log=level log level for tntnet (values: INFO, DEBUG,...)\n";
m_helpString = builder.str();
}
return m_helpString.c_str();
diff --git a/setup.h b/setup.h
index c888dea..7952740 100644
--- a/setup.h
+++ b/setup.h
@@ -44,7 +44,7 @@ public:
std::string GetLocalNetMask() const { return m_localnetmask; };
bool GetIsLocalNet() const { return m_islocalnet; };
std::string GetLastWhatsOnListMode() const { return m_lastwhatsonlistmode; }
-
+ std::string GetTntnetLogLevel() const { return m_tntnetloglevel; }
void SetLastChannel(int lastChannel) { m_lastChannel = lastChannel; }
void SetAdminLogin(std::string login) { m_adminLogin = login; }
std::string SetAdminPassword(std::string password);
@@ -92,6 +92,7 @@ private:
std::string m_localnetmask;
bool m_islocalnet;
std::string m_lastwhatsonlistmode;
+ std::string m_tntnetloglevel;
bool CheckServerPort();
bool CheckServerIps();
diff --git a/tntconfig.cpp b/tntconfig.cpp
index 08a037d..b38865c 100644
--- a/tntconfig.cpp
+++ b/tntconfig.cpp
@@ -73,8 +73,8 @@ void TntConfig::WriteProperties()
}
// XXX modularize
- file << "rootLogger=INFO" << endl;
- file << "logger.tntnet=INFO" << endl;
+ file << "rootLogger=" << LiveSetup().GetTntnetLogLevel() << endl;
+ file << "logger.tntnet=" << LiveSetup().GetTntnetLogLevel() << endl;
}
TntConfig const& TntConfig::Get()