OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreLogManager.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 
29 #ifndef __LogManager_H__
30 #define __LogManager_H__
31 
32 #include "OgrePrerequisites.h"
33 
34 #include "OgreLog.h"
35 #include "OgreSingleton.h"
36 #include "OgreHeaderPrefix.h"
37 
38 namespace Ogre
39 {
64  class _OgreExport LogManager : public Singleton<LogManager>, public LogAlloc
65  {
66  protected:
68 
71 
74 
75  public:
76  OGRE_AUTO_MUTEX; // public to allow external locking
77 
78  LogManager();
79  ~LogManager();
80 
97  Log* createLog( const String& name, bool defaultLog = false, bool debuggerOutput = true,
98  bool suppressFileOutput = false);
99 
102  Log* getLog( const String& name);
103 
106  Log* getDefaultLog();
107 
109  void destroyLog(const String& name);
111  void destroyLog(Log* log);
112 
116  Log* setDefaultLog(Log* newLog);
117 
120  void logMessage( const String& message, LogMessageLevel lml = LML_NORMAL,
121  bool maskDebug = false);
122 
125  void logMessage( LogMessageLevel lml, const String& message,
126  bool maskDebug = false) { logMessage(message, lml, maskDebug); }
127 
129  Log::Stream stream(LogMessageLevel lml = LML_NORMAL,
130  bool maskDebug = false);
131 
134  void setLogDetail(LoggingLevel ll);
150  static LogManager& getSingleton(void);
166  static LogManager* getSingletonPtr(void);
167 
168  };
169 
170 
173 }
174 
175 #include "OgreHeaderSuffix.h"
176 
177 #endif
#define _OgreExport
Definition: OgrePlatform.h:255
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
LoggingLevel
The level of detail to which the log will go into.
Definition: OgreLog.h:57
Stream object which targets a log.
Definition: OgreLog.h:201
Log * mDefaultLog
The default log to which output is done.
The log manager handles the creation and retrieval of logs for the application.
LogList mLogs
A list of all the logs the manager can access.
void logMessage(LogMessageLevel lml, const String &message, bool maskDebug=false)
Log a message to the default log (signature for backward compatibility).
map< String, Log * >::type LogList
LogMessageLevel
The importance of a logged message.
Definition: OgreLog.h:66
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
_StringBase String
Definition: OgreCommon.h:53