#include <config.h>
#include <assert.h>
-#include "msg.hpp"
+#include "log.hpp"
#include "main.hpp"
#include <stdexcept>
try {
config->load();
} catch(std::exception& e) {
- msg_info << "Couldn't load config file: " << e.what() << ", using default settings" << std::endl;
+ log_info << "Couldn't load config file: " << e.what() << ", using default settings" << std::endl;
}
}
if(f) {
fclose(f);
if(!PHYSFS_addToSearchPath(dir.c_str(), 1)) {
- msg_warning << "Couldn't add '" << dir << "' to physfs searchpath: " << PHYSFS_getLastError() << std::endl;
+ log_warning << "Couldn't add '" << dir << "' to physfs searchpath: " << PHYSFS_getLastError() << std::endl;
} else {
sourcedir = true;
}
datadir = APPDATADIR;
#endif
if(!PHYSFS_addToSearchPath(datadir.c_str(), 1)) {
- msg_warning << "Couldn't add '" << datadir << "' to physfs searchpath: " << PHYSFS_getLastError() << std::endl;
+ log_warning << "Couldn't add '" << datadir << "' to physfs searchpath: " << PHYSFS_getLastError() << std::endl;
}
#endif
}
//show search Path
for(char** i = PHYSFS_getSearchPath(); *i != NULL; i++)
- msg_info << "[" << *i << "] is in the search path" << std::endl;
+ log_info << "[" << *i << "] is in the search path" << std::endl;
}
static void print_usage(const char* argv0)
print_usage(argv[0]);
return true;
} else if(arg == "--version") {
- msg_info << PACKAGE_NAME << " " << PACKAGE_VERSION << std::endl;
+ log_info << PACKAGE_NAME << " " << PACKAGE_VERSION << std::endl;
return true;
} else if(arg[0] != '-') {
config->start_level = arg;
} else {
- msg_warning << "Unknown option '" << arg << "'. Use --help to see a list of options" << std::endl;
+ log_warning << "Unknown option '" << arg << "'. Use --help to see a list of options" << std::endl;
}
}
}
#ifdef DEBUG
else {
- msg_warning << "Couldn't find icon 'images/engine/icons/supertux.xpm'" << std::endl;
+ log_warning << "Couldn't find icon 'images/engine/icons/supertux.xpm'" << std::endl;
}
#endif
Uint32 current_ticks = SDL_GetTicks();
if(last_timelog_component != 0) {
- msg_info << "Component '" << last_timelog_component << "' finished after " << (current_ticks - last_timelog_ticks) / 1000.0 << " seconds" << std::endl;
+ log_info << "Component '" << last_timelog_component << "' finished after " << (current_ticks - last_timelog_ticks) / 1000.0 << " seconds" << std::endl;
}
last_timelog_ticks = current_ticks;
init_audio();
timelog("video");
init_video();
- Console::instance = new Console();
+ Console::instance = new Console();
timelog("scripting");
init_scripting();
timelog("menu");
setup_menu();
timelog("resources");
- load_shared();
+ load_shared();
timelog(0);
main_loop = new MainLoop();
main_loop->run();
} catch(std::exception& e) {
- msg_fatal << "Unexpected exception: " << e.what() << std::endl;
+ log_fatal << "Unexpected exception: " << e.what() << std::endl;
result = 1;
} catch(...) {
- msg_fatal << "Unexpected exception" << std::endl;
+ log_fatal << "Unexpected exception" << std::endl;
result = 1;
}