O3dLog.cpp

Go to the documentation of this file.
00001 /*
00002 SagaEngine library
00003 Copyright (c) 2002-2006 Skalden Studio AS
00004 
00005 This software is provided 'as-is', without any express or implied 
00006 warranty. In no event will the authors be held liable for any 
00007 damages arising from the use of this software.
00008 
00009 Permission is granted to distribute the library under the terms of the 
00010 Q Public License version 1.0. Be sure to read and understand the license
00011 before using the library. It should be included here, or you may read it
00012 at http://www.trolltech.com/products/qt/licenses/licensing/qpl
00013 
00014 The original version of this library can be located at:
00015 http://www.sagaengine.com/
00016 
00017 Rune Myrland
00018 rune@skalden.com
00019 */
00020 
00021 
00022 #include "O3dLog.hpp"
00023 #ifdef IS_OGRE
00024 #include "o3d/schema/O3dSchema.hpp"
00025 #  include <OgreException.h>
00026 #  include <OgreLogManager.h>
00027 #endif
00028 #ifdef _WINDOWS
00029 #  include <Windows.h>
00030 #endif
00031 #include <iostream>
00032 #include <ctime>
00033 #include <cstdio>
00034 
00035 namespace se_err {
00037     /*
00038     void scream3(const char* file, int line, const char* msg) {
00039         // Fatal
00040         char* buffer = new char[512];
00041         sprintf(buffer, "Fat: \"%s\" (%s-%d)", msg, file, line);
00042         dump(buffer);
00043 
00044 #   ifdef _WINDOWS
00045         // Unhandled exception throws to debugger in Visual C++.
00046         throw 0.0f;
00047 #   else
00048         // Throws gdb into debugger
00049         assert(false);
00050 #   endif
00051 
00052         throw buffer;
00053         //throw( Ogre::Exception( Ogre::Exception::ERR_RT_ASSERTION_FAILED, msg, "LogFatal", const_cast<char*>(file), line) );
00054     }
00055 
00056 
00057     void say3(const char* file, int line, const char* msg) {
00058         // Msg
00059         char buffer[512];
00060         sprintf(buffer, "Msg: \"%s\" (%s-%d)", msg, file, line);
00061         dump(buffer);
00062     }
00063 
00064 
00065     void dump(const char *msg) {
00066 #   ifdef _WINDOWS
00067         //OutputDebugString(msg);
00068         //OutputDebugString("\n");
00069 #   endif
00070         if(se_ogre::O3dSchema::sceneManager)
00071             Ogre::LogManager::getSingleton().logMessage(msg);
00072         else
00073             std::cerr << msg << std::endl;
00074     }
00075     */
00076 }

Home Page | SagaEngine trunk (updated nightly) reference generated Sun Dec 2 20:06:04 2007 by Doxygen version 1.3.9.1.

SourceForge.net Logo