diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2007-06-04 17:09:45 +0000 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2007-06-04 17:09:45 +0000 |
commit | 0ad2091a1c1fbe6586e322ef467db20b86f0bb48 (patch) | |
tree | 8ef3cb88add1d9dd1f59a75b878e633c7f074eed | |
parent | 29523906a06e4ff526782e6754434fc441e09b9a (diff) | |
download | vdr-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.cpp | 10 | ||||
-rw-r--r-- | setup.h | 3 | ||||
-rw-r--r-- | tntconfig.cpp | 4 |
3 files changed, 11 insertions, 6 deletions
@@ -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(); @@ -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() |