From 092e4ae75e28fca8cf13d0315eb3923ba1c27133 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Wed, 4 Jul 2012 19:20:22 +0200 Subject: Enabled logging & minor fixes - added logger to main() - removed reference to Snd namespace and renamed back to sound.h - fixed minor issues --- src/app/main.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/app/main.cpp') diff --git a/src/app/main.cpp b/src/app/main.cpp index 54d305e..151cd20 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -19,6 +19,7 @@ #include "app/app.h" #include "app/system.h" +#include "common/logger.h" #include "common/misc.h" #include "common/restext.h" @@ -26,6 +27,10 @@ //! Entry point to the program int main(int argc, char *argv[]) { + CLogger logger; // Create the logger + + logger.Info("Colobot starting\n"); + CApplication app; // single instance of the application Error err = app.ParseArguments(argc, argv); @@ -34,8 +39,18 @@ int main(int argc, char *argv[]) SystemDialog(SDT_ERROR, "COLOBOT", "Invalid commandline arguments!\n"); } + int code = 0; + if (! app.Create()) - return 0; + { + code = app.GetExitCode(); + logger.Info("Didn't run main loop. Exiting with code %d\n", code); + return code; + } + + code = app.Run(); - return app.Run(); + logger.Info("Exiting with code %d\n", code); + return code; } + -- cgit v1.2.3-1-g7c22