Panda3D
Loading...
Searching...
No Matches
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
18PandaLogger *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 */
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 */
37void PandaLogger::OnDebug(const char *message) {
38 assimp_cat.debug() << message << "\n";
39}
40
41/**
42 *
43 */
44void PandaLogger::OnVerboseDebug(const char *message) {
45 if (assimp_cat.is_spam()) {
46 assimp_cat.spam() << message << "\n";
47 }
48}
49
50/**
51 *
52 */
53void PandaLogger::OnError(const char *message) {
54 assimp_cat.error() << message << "\n";
55}
56
57/**
58 *
59 */
60void PandaLogger::OnInfo(const char *message) {
61 assimp_cat.info() << message << "\n";
62}
63
64/**
65 *
66 */
67void PandaLogger::OnWarn(const char *message) {
68 assimp_cat.warning() << message << "\n";
69}
Custom implementation of Assimp::Logger.
Definition pandaLogger.h:25
static void set_default()
Makes sure there's a global PandaLogger object and makes sure that it is Assimp's default logger.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.