Panda3D
pandaLogger.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file pandaLogger.cxx
10  * @author rdb
11  * @date 2011-05-05
12  */
13 
14 #include "pandaLogger.h"
15 
16 #include <assimp/DefaultLogger.hpp>
17 
18 PandaLogger *PandaLogger::_ptr = nullptr;
19 
20 /**
21  * Makes sure there's a global PandaLogger object and makes sure that it is
22  * Assimp's default logger.
23  */
24 void PandaLogger::
26  if (_ptr == nullptr) {
27  _ptr = new PandaLogger;
28  }
29  if (_ptr != Assimp::DefaultLogger::get()) {
30  Assimp::DefaultLogger::set(_ptr);
31  }
32 }
33 
34 /**
35  *
36  */
37 void PandaLogger::OnDebug(const char *message) {
38  assimp_cat.debug() << message << "\n";
39 }
40 
41 /**
42  *
43  */
44 void PandaLogger::OnError(const char *message) {
45  assimp_cat.error() << message << "\n";
46 }
47 
48 /**
49  *
50  */
51 void PandaLogger::OnInfo(const char *message) {
52  assimp_cat.info() << message << "\n";
53 }
54 
55 /**
56  *
57  */
58 void PandaLogger::OnWarn(const char *message) {
59  assimp_cat.warning() << message << "\n";
60 }
Custom implementation of Assimp::Logger.
Definition: pandaLogger.h:25
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static void set_default()
Makes sure there's a global PandaLogger object and makes sure that it is Assimp's default logger.
Definition: pandaLogger.cxx:25