V-Gears 0
Free Final Fantasy VII engine.
Logger.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#pragma once
17
18#include <OgreLogManager.h>
19#include <OgreString.h>
20#include <OgreStringConverter.h>
21#include <string>
22
28#define LOG_ERROR(message) Ogre::LogManager::getSingleton().logMessage( \
29 "[ERROR] " + Ogre::String(__FILE__) + " " \
30 + Ogre::StringConverter::toString(__LINE__) + ": " + message, \
31 Ogre::LML_CRITICAL \
32)
33
39#define LOG_WARNING(message) Ogre::LogManager::getSingleton().logMessage( \
40 "[WARNING] " + Ogre::String(__FILE__) + " " \
41 + Ogre::StringConverter::toString(__LINE__) + ": " + message, \
42 Ogre::LML_NORMAL \
43)
44
50#define LOG_TRIVIAL(message) Ogre::LogManager::getSingleton().logMessage( \
51 message, Ogre::LML_TRIVIAL \
52)
53
59#define LOG_CONSOLE(message) Ogre::LogManager::getSingleton().logMessage( \
60 message, Ogre::LML_NORMAL \
61)
62
63// TODO: Remove microsoft tools and leave only the generic?
64#ifdef _MSC_VER
65
73#define LOG_DEBUG_EX(message) Ogre::LogManager::getSingleton().logMessage( \
74 "[DEBUG] (" + __FILE__ + " " + Ogre::StringConverter::toString(__LINE__) \
75 + ")(" + std::string(__FUNCTION__) + "): " + message, \
76 Ogre::LML_CRITICAL \
77 )
78
86#define LOG_DEBUG(message) Ogre::LogManager::getSingleton().logMessage(\
87 "[DEBUG] (" + std::string(__FUNCTION__) + "): " + message, \
88 Ogre::LML_CRITICAL \
89)
90#else
91
99#define LOG_DEBUG_EX(message) Ogre::LogManager::getSingleton().logMessage( \
100 "[DEBUG] (" + __FILE__ + " " + Ogre::StringConverter::toString(__LINE__) \
101 + ")(" + std::string(__PRETTY_FUNCTION__) + "): " + message, \
102 Ogre::LML_CRITICAL \
103)
104
112#define LOG_DEBUG(message) Ogre::LogManager::getSingleton().logMessage( \
113 "[DEBUG] (" + std::string(__PRETTY_FUNCTION__) + "): " + message, \
114 Ogre::LML_CRITICAL \
115)
116#endif