summaryrefslogtreecommitdiff
path: root/src/crawl/crawl.cpp
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2014-10-11 12:57:13 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2014-10-11 12:57:13 +0200
commitb9646506afc678379a2b8ce2f52a0d3552ac5375 (patch)
tree727db94a77075d7a93b0d4097414a819bfefb375 /src/crawl/crawl.cpp
parenta613ebbe1b544a854645eda518e18ab3e91b75b6 (diff)
downloadcrawler-b9646506afc678379a2b8ce2f52a0d3552ac5375.tar.gz
crawler-b9646506afc678379a2b8ce2f52a0d3552ac5375.tar.bz2
reading debug level and module dir from config
Diffstat (limited to 'src/crawl/crawl.cpp')
-rwxr-xr-xsrc/crawl/crawl.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/crawl/crawl.cpp b/src/crawl/crawl.cpp
index e26de0a..5070c39 100755
--- a/src/crawl/crawl.cpp
+++ b/src/crawl/crawl.cpp
@@ -67,9 +67,8 @@ int main( int /* argc */, char *argv[] )
{
try {
LuaVM luaVm;
-
-// Logger::instance( ).openConsoleLog( logINFO );
- Logger::instance( ).openConsoleLog( logDEBUG );
+
+ //Logger::instance( ).openConsoleLog( logDEBUG );
// load configuration (Lua) and execute main (to
// get basic configuration in form of global
@@ -77,6 +76,9 @@ int main( int /* argc */, char *argv[] )
luaVm.loadSource( argv[1] );
luaVm.executeMain( );
+ std::string logLevel = luaVm.getString( "logger.level" );
+ Logger::instance( ).openConsoleLog( Logger::fromString( logLevel ) );
+
#ifndef _WIN32
struct sigaction sa;
memset( &sa, 0, sizeof( struct sigaction ) );
@@ -89,8 +91,9 @@ int main( int /* argc */, char *argv[] )
SetConsoleCtrlHandler( termHandler, TRUE );
#endif
- // go through all type of modules and load them with the proper loader
- LOG( logNOTICE ) << "Loading modules";
+ // go through all type of modules and load them with the proper loader
+ string modulePath = luaVm.getString( "crawler.module_path" );
+ LOG( logNOTICE ) << "Loading modules from path '" << modulePath << "'";
vector<string> normalizerModules;
#ifndef _WIN32