 |
Blamite Game Engine - Strings
00386.06.16.23.0646.blamite
A library containing general purpose utilities and classes for use in multiple projects.
|
Go to the documentation of this file.
10 #define STRINGS_API __declspec(dllexport)
12 #define STRINGS_API __declspec(dllimport)
15 #define LOGGER_ID_GUERILLA 1
16 #define LOGGER_ID_KEYSTONE 2
17 #define LOGGER_ID_STRINGS 3
18 #define LOGGER_ID_TOOL 4
19 #define LOGGER_ID_UNIFIED 5
22 #define WSV_NONE BlamLogLevel::None
23 #define WSV_ERROR BlamLogLevel::Error
24 #define WSV_WARNING BlamLogLevel::Warning
25 #define WSV_SEVERE BlamLogLevel::Severe
69 #define WVIS_NONE BlamLogVisibility::None
70 #define WVIS_ALL BlamLogVisibility::All
71 #define WVIS_STDOUT_ONLY BlamLogVisibility::StdoutOnly
72 #define WVIS_FILE_ONLY BlamLogVisibility::FileOnly
73 #define WVIS_HTML_ONLY BlamLogVisibility::HTMLOnly
74 #define WVIS_TXT_ONLY BlamLogVisibility::TXTOnly
143 bool show_timestamp =
true;
145 bool override_color =
false;
150 bool override_duplicate_limit =
false;
162 bool has_custom_color =
false;
163 std::string message =
"";
164 std::string timestamp =
"";
177 std::string GetMessageLine();
214 bool print_to_stdout =
false;
216 std::vector<BlamBasicLogMessage> history = std::vector<BlamBasicLogMessage>();
217 std::vector<BlamLogReceiver*> receivers = std::vector<BlamLogReceiver*>();
245 void SetCommandLinePrintingEnabled(
bool print_to_cmd);
252 std::vector<BlamBasicLogMessage>
GetHistory();
std::string timestamp
The message timestamp.
Definition: logger.h:164
@ All
The message will be shown in all places where log output can be written.
STRINGS_API void LogEvent(std::string message, TerminalColor color)
Logs an event to the logger.
Definition: logger.cpp:57
Interface used to receive log messages.
Definition: logger.h:192
void RemoveReceiver(BlamLogReceiver *receiver)
Unregisters a receiver from this logger.
Definition: BlamBasicLogger.cpp:107
@ ObjectMaterialsDebug
RESERVED Report file for object-specific material messages.
BlamLogVisibility
Enumerator to specify log event visibility.
Definition: logger.h:79
@ ShadersDebug
BlamReport file for shader messages.
Class represneting a basic log message.
Definition: logger.h:156
BlamBasicLogger()
Initializes a new logger.
Definition: BlamBasicLogger.cpp:5
STRINGS_API std::string GenerateLogLevelPrefix(BlamLogLevel log_level)
Generates a prefix for a given log level, such as [INFO] or [WARN].
Definition: logger.cpp:7
BlamBasicLogger * unified_logger
Definition: logger.cpp:3
std::vector< BlamBasicLogMessage > GetHistory()
Retrieves the log history.
Definition: BlamBasicLogger.cpp:28
STRINGS_API void AddReceiver(BlamLogReceiver *receiver)
Registers a receiver which will be notified on new log messages.
Definition: logger.cpp:67
virtual void LogMessageReceived(BlamBasicLogMessage message)
Called whenever a log message is received.
Definition: logger.h:200
#define LOGGER_ID_UNIFIED
Definition: logger.h:19
STRINGS_API void LogEvent(BlamBasicLogMessage message)
Logs an event to the logger.
Definition: logger.cpp:27
STRINGS_API void ShutdownLogger()
Shuts down the logger.
Definition: logger.cpp:18
bool Equals(BlamBasicLogMessage other_message)
Checks if the log message is equivalent to another log message.
Definition: BlamBasicLogMessage.cpp:10
@ LocalizationDebug
RESERVED Report file for string and localization debug messages.
@ HSLog
RESERVED Report file for script-related messages.
#define STRINGS_API
Definition: logger.h:12
@ NetworkingDebug
RESERVED Report file for networking debug messages.
BlamColor color
The overridden color information. Overrules any severity-based coloring.
Definition: logger.h:146
std::string message
The message contents.
Definition: logger.h:141
BlamBasicLogger * logger
The logger that the message originated from.
Definition: logger.h:159
@ FileOnly
The message will only be written to the log file.
@ MultiplayerDebug
RESERVED Report file for multiplayer game debug.
STRINGS_API BlamBasicLogger * GetLogger()
Retrieves the unified logger.
Definition: logger.cpp:5
@ AnimationAudioContentDebug
RESERVED
#define WVIS_ALL
Macro for 'All' log visibility. Original pre-enum value was 0.
Definition: logger.h:70
@ HTMLOnly
The message will only be written to the log file, if the file is in HTML format.
std::string GetMessageLine()
Generates a formatted message, ready to be written to any output or log.
Definition: BlamBasicLogMessage.cpp:5
@ ObjectsDebug
RESERVED Report file for game object debug messages.
@ UIDebug
BlamReport file for all UI messages.
@ TXTOnly
The message will only be written to the log file, if the file is in plain text format.
STRINGS_API TerminalColor TranslateLogLevelAsColor(BlamLogLevel log_level)
Translates a given BlamLogLevel into the appropriate terminal color.
Definition: logger.cpp:29
STRINGS_API void PrepareLogger()
Prepares the logger.
Definition: logger.cpp:10
STRINGS_API void RemoveReceiver(BlamLogReceiver *receiver)
Unregisters a receiver.
Definition: logger.cpp:77
BlamLogLevel log_level
The message log level.
Definition: logger.h:160
BlamReportType
Enumerator containing possible report types.
Definition: logger.h:100
STRINGS_API std::string GetTimeLogFormat()
Retrieves the current date/time in the following format, for use in the logger: MM....
Definition: datetime.cpp:29
@ DebugFull
Similar to debug, but includes additional messages that are typically hidden from debug.
@ Error
Indicates an error that could cause engine instability.
@ SoundDebug
RESERVED Report file for sound/audio-related debug messages.
@ None
Indicates no severity, and is displayed with no formatting.
@ LeaderboardDebug
RESERVED Report file for leaderboard debug messages. GAME-SPECIFIC
void AddReceiver(BlamLogReceiver *receiver)
Registers a receiver to this logger.
Definition: BlamBasicLogger.cpp:99
void LogEvent(BlamBasicLogMessage message)
Writes a message to the log.
Definition: BlamBasicLogger.cpp:33
std::string message
The message content.
Definition: logger.h:163
@ EnvironmentDebug
RESERVED
@ TagDebug
BlamReport file for all tag related messages.
@ DesignDebug
RESERVED Report file for level design debug.
void ClearHistory()
Clears all log history.
Definition: BlamBasicLogger.cpp:18
@ AnimationDebug
RESERVED Report file for animation debug messages.
@ Severe
Indicates a severe error that the engine cannot recover from.
@ Debug
Default report file. Contains all log messages found in other reports, excluding debug_full.
#define WSV_NONE
Macro for 'None' log seveirty.
Definition: logger.h:22
@ PlayerRewardsDebug
RESERVED Report file for player reward debug messages. GAME-SPECIFIC
Structure to store log message data.
Definition: logger.h:136
Namespace containing functions related to the logger.
Definition: logger.h:302
STRINGS_API std::vector< BlamBasicLogMessage > GetHistory()
Retrieves log history.
Definition: logger.cpp:87
bool has_custom_color
Whether or not the message has a custom terminal color set.
Definition: logger.h:162
std::string timestamp
The timestamp of the log message.
Definition: logger.h:140
TerminalColor
Enumerator listing all possible terminal colors.
Definition: logger.h:35
@ AIDebug
RESERVED Report file for AI debug messages.
@ StdoutOnly
The message will only be shown to the in-game console and STDOUT.
Class representing a color.
Definition: BlamColor.h:19
Class representing a basic logger.
Definition: logger.h:211
BlamLogLevel
Enumerator to specify log event severity.
Definition: logger.h:60
TerminalColor color
The custom color to assign to the message when printing to stdout.
Definition: logger.h:161
@ StreamManagerDebug
RESERVED
void SetCommandLinePrintingEnabled(bool print_to_cmd)
Sets whether or not log messages should be written to the standard output.
Definition: BlamBasicLogger.cpp:23
@ Warning
Indicates a warning message. Not something critical, but something that could cause unexpected behavi...
@ GeometryDebug
RESERVED Report file for geometry-related messages.
@ EnvironmentMaterialsDebug
RESERVED Report file for environment-specific material messages.
STRINGS_API void PrintMessageToStdout(std::string message, TerminalColor color)
Prints a message to the standard output.
Definition: logger.cpp:49