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