Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
LogLevel.hpp
Go to the documentation of this file.
1/*
2Copyright (C) 2016,2018,2019,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
19#ifndef AEONGAMES_LOGLEVEL_H
20#define AEONGAMES_LOGLEVEL_H
22#include <iostream>
23
24namespace AeonGames
25{
35
40 inline std::ostream& operator<< ( std::ostream& os, LogLevel level )
41 {
42 switch ( level )
43 {
44 case LogLevel::Debug:
45 os << "\x1B[34m" << "[DEBUG]" << "\x1B[m ";
46 break;
47 case LogLevel::Info:
48 os << "\x1B[32m" << "[INFO]" << "\x1B[m ";
49 break;
51 os << "\x1B[35m" << "[PERFORMANCE]" << "\x1B[m ";
52 break;
54 os << "\x1B[33m" << "[WARNING]" << "\x1B[m ";
55 break;
56 case LogLevel::Error:
57 os << "\x1B[31m" << "[ERROR]" << "\x1B[m ";
58 break;
59 }
60 return os;
61 }
62}
63#endif
Platform-specific macros, includes, and DLL export/import definitions.
<- This is here just for the literals
Definition AABB.hpp:31
std::ostream & operator<<(std::ostream &os, LogLevel level)
Inserts a color-coded log level tag into an output stream.
Definition LogLevel.hpp:40
LogLevel
Severity levels for engine log messages.
Definition LogLevel.hpp:28
@ Warning
Potential issues that may need attention.
Definition LogLevel.hpp:32
@ Info
General informational messages.
Definition LogLevel.hpp:30
@ Error
Error conditions.
Definition LogLevel.hpp:33
@ Performance
Performance-related metrics.
Definition LogLevel.hpp:31
@ Debug
Detailed diagnostic information.
Definition LogLevel.hpp:29