Elaztek Developer Hub
Blamite Game Engine - Strings  00390.07.02.23.1947.blamite
A library containing general purpose utilities and classes for use in multiple projects.
logger.h File Reference
#include <string>
#include <vector>
#include "Strings/components/resources/color/BlamColor.h"
#include "Strings/components/utils/datetime/datetime.h"
+ Include dependency graph for logger.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BlamLogMessage
 Structure to store log message data. More...
 
class  BlamBasicLogMessage
 Class represneting a basic log message. More...
 
class  BlamLogReceiver
 Interface used to receive log messages. More...
 
class  BlamBasicLogger
 Class representing a basic logger. More...
 

Namespaces

 BlamStrings
 Namespace for Blamite's shared C++ library.
 
 BlamStrings::Interface
 
 BlamStrings::Interface::Logger
 Namespace containing functions related to the logger.
 

Macros

#define STRINGS_API   __declspec(dllimport)
 
#define LOGGER_ID_GUERILLA   1
 
#define LOGGER_ID_KEYSTONE   2
 
#define LOGGER_ID_STRINGS   3
 
#define LOGGER_ID_TOOL   4
 
#define LOGGER_ID_UNIFIED   5
 
#define WSV_NONE   BlamLogLevel::None
 Macro for 'None' log seveirty. More...
 
#define WSV_ERROR   BlamLogLevel::Error
 Macro for 'Error' log seveirty. More...
 
#define WSV_WARNING   BlamLogLevel::Warning
 Macro for 'Warning' log seveirty. More...
 
#define WSV_SEVERE   BlamLogLevel::Severe
 Macro for 'Severe' log seveirty. More...
 
#define WVIS_NONE   BlamLogVisibility::None
 Macro for 'None' log visibility. Original pre-enum value was -1. More...
 
#define WVIS_ALL   BlamLogVisibility::All
 Macro for 'All' log visibility. Original pre-enum value was 0. More...
 
#define WVIS_STDOUT_ONLY   BlamLogVisibility::StdoutOnly
 Macro for 'StdoutOnly' log visibility. Original pre-enum value was 1. More...
 
#define WVIS_FILE_ONLY   BlamLogVisibility::FileOnly
 Macro for 'FileOnly' log visibility. Original pre-enum value was 2. More...
 
#define WVIS_HTML_ONLY   BlamLogVisibility::HTMLOnly
 Macro for 'HTMLOnly' log visibility. Original pre-enum value was 3. More...
 
#define WVIS_TXT_ONLY   BlamLogVisibility::TXTOnly
 Macro for 'TXTOnly' log visibility. Original pre-enum value was 4. More...
 

Enumerations

enum  TerminalColor {
  TerminalColor::Black, TerminalColor::Blue, TerminalColor::Green, TerminalColor::Cyan,
  TerminalColor::Red, TerminalColor::Magenta, TerminalColor::Gold, TerminalColor::Gray,
  TerminalColor::DarkGray, TerminalColor::BrightBlue, TerminalColor::BrightGreen, TerminalColor::BrightCyan,
  TerminalColor::BrightRed, TerminalColor::BrightMagenta, TerminalColor::Yellow, TerminalColor::White,
  TerminalColor::Reset
}
 Enumerator listing all possible terminal colors. More...
 
enum  BlamLogLevel { BlamLogLevel::None, BlamLogLevel::Warning, BlamLogLevel::Error, BlamLogLevel::Severe }
 Enumerator to specify log event severity. More...
 
enum  BlamLogVisibility {
  BlamLogVisibility::None, BlamLogVisibility::All, BlamLogVisibility::StdoutOnly, BlamLogVisibility::FileOnly,
  BlamLogVisibility::HTMLOnly, BlamLogVisibility::TXTOnly
}
 Enumerator to specify log event visibility. More...
 
enum  BlamReportType {
  BlamReportType::Debug, BlamReportType::DebugFull, BlamReportType::TagDebug, BlamReportType::UIDebug,
  BlamReportType::ShadersDebug, BlamReportType::AIDebug, BlamReportType::AnimationAudioContentDebug, BlamReportType::AnimationDebug,
  BlamReportType::BandwidthDebug, BlamReportType::Content, BlamReportType::DesignDebug, BlamReportType::EffectsDebug,
  BlamReportType::EnvironmentDebug, BlamReportType::EnvironmentMaterialsDebug, BlamReportType::GeometryDebug, BlamReportType::HSLog,
  BlamReportType::IncidentDebug, BlamReportType::LeaderboardDebug, BlamReportType::LocalizationDebug, BlamReportType::MultiplayerDebug,
  BlamReportType::NetworkingDebug, BlamReportType::ObjectMaterialsDebug, BlamReportType::ObjectsDebug, BlamReportType::PlayerRewardsDebug,
  BlamReportType::SoundDebug, BlamReportType::StreamManagerDebug, BlamReportType::SystemLog
}
 Enumerator containing possible report types. More...
 

Functions

STRINGS_API std::string BlamStrings::Interface::Logger::GenerateLogLevelPrefix (BlamLogLevel log_level)
 Generates a prefix for a given log level, such as [INFO] or [WARN]. More...
 
STRINGS_API TerminalColor BlamStrings::Interface::Logger::TranslateLogLevelAsColor (BlamLogLevel log_level)
 Translates a given BlamLogLevel into the appropriate terminal color. More...
 
STRINGS_API void BlamStrings::Interface::Logger::PrintMessageToStdout (std::string message, TerminalColor color)
 Prints a message to the standard output. More...
 

Macro Definition Documentation

◆ LOGGER_ID_GUERILLA

#define LOGGER_ID_GUERILLA   1

◆ LOGGER_ID_KEYSTONE

#define LOGGER_ID_KEYSTONE   2

◆ LOGGER_ID_STRINGS

#define LOGGER_ID_STRINGS   3

◆ LOGGER_ID_TOOL

#define LOGGER_ID_TOOL   4

◆ LOGGER_ID_UNIFIED

#define LOGGER_ID_UNIFIED   5

◆ STRINGS_API

#define STRINGS_API   __declspec(dllimport)

◆ WSV_ERROR

#define WSV_ERROR   BlamLogLevel::Error

Macro for 'Error' log seveirty.

◆ WSV_NONE

#define WSV_NONE   BlamLogLevel::None

Macro for 'None' log seveirty.

◆ WSV_SEVERE

#define WSV_SEVERE   BlamLogLevel::Severe

Macro for 'Severe' log seveirty.

◆ WSV_WARNING

#define WSV_WARNING   BlamLogLevel::Warning

Macro for 'Warning' log seveirty.

◆ WVIS_ALL

#define WVIS_ALL   BlamLogVisibility::All

Macro for 'All' log visibility. Original pre-enum value was 0.

◆ WVIS_FILE_ONLY

#define WVIS_FILE_ONLY   BlamLogVisibility::FileOnly

Macro for 'FileOnly' log visibility. Original pre-enum value was 2.

◆ WVIS_HTML_ONLY

#define WVIS_HTML_ONLY   BlamLogVisibility::HTMLOnly

Macro for 'HTMLOnly' log visibility. Original pre-enum value was 3.

◆ WVIS_NONE

#define WVIS_NONE   BlamLogVisibility::None

Macro for 'None' log visibility. Original pre-enum value was -1.

◆ WVIS_STDOUT_ONLY

#define WVIS_STDOUT_ONLY   BlamLogVisibility::StdoutOnly

Macro for 'StdoutOnly' log visibility. Original pre-enum value was 1.

◆ WVIS_TXT_ONLY

#define WVIS_TXT_ONLY   BlamLogVisibility::TXTOnly

Macro for 'TXTOnly' log visibility. Original pre-enum value was 4.

Enumeration Type Documentation

◆ BlamLogLevel

enum BlamLogLevel
strong

Enumerator to specify log event severity.

Enumerator
None 

Indicates no severity, and is displayed with no formatting.

Warning 

Indicates a warning message. Not something critical, but something that could cause unexpected behavior.

Error 

Indicates an error that could cause engine instability.

Severe 

Indicates a severe error that the engine cannot recover from.

◆ BlamLogVisibility

enum BlamLogVisibility
strong

Enumerator to specify log event visibility.

Enumerator
None 

The message will not be visible anywhere.

All 

The message will be shown in all places where log output can be written.

StdoutOnly 

The message will only be shown to the in-game console and STDOUT.

FileOnly 

The message will only be written to the log file.

HTMLOnly 

The message will only be written to the log file, if the file is in HTML format.

TXTOnly 

The message will only be written to the log file, if the file is in plain text format.

◆ BlamReportType

enum BlamReportType
strong

Enumerator containing possible report types.

Some enumerator values will have certain tags assigned to them as follows:

  • RESERVED - This is a possible future report type, but it is not currently in use.
  • GAME-SPECIFIC - This is a report type that, in the future, should be made game-specific.

In the future, individual projects should be able to include custom report types. At this point, the report types listed as "game-specific" should be removed here and should be moved to a sample project or something like that.

Enumerator
Debug 

Default report file. Contains all log messages found in other reports, excluding debug_full.

DebugFull 

Similar to debug, but includes additional messages that are typically hidden from debug.

TagDebug 

BlamReport file for all tag related messages.

UIDebug 

BlamReport file for all UI messages.

ShadersDebug 

BlamReport file for shader messages.

AIDebug 

RESERVED Report file for AI debug messages.

AnimationAudioContentDebug 

RESERVED

AnimationDebug 

RESERVED Report file for animation debug messages.

BandwidthDebug 

RESERVED

Content 

RESERVED

DesignDebug 

RESERVED Report file for level design debug.

EffectsDebug 

RESERVED

EnvironmentDebug 

RESERVED

EnvironmentMaterialsDebug 

RESERVED Report file for environment-specific material messages.

GeometryDebug 

RESERVED Report file for geometry-related messages.

HSLog 

RESERVED Report file for script-related messages.

IncidentDebug 

RESERVED

LeaderboardDebug 

RESERVED Report file for leaderboard debug messages. GAME-SPECIFIC

LocalizationDebug 

RESERVED Report file for string and localization debug messages.

MultiplayerDebug 

RESERVED Report file for multiplayer game debug.

NetworkingDebug 

RESERVED Report file for networking debug messages.

ObjectMaterialsDebug 

RESERVED Report file for object-specific material messages.

ObjectsDebug 

RESERVED Report file for game object debug messages.

PlayerRewardsDebug 

RESERVED Report file for player reward debug messages. GAME-SPECIFIC

SoundDebug 

RESERVED Report file for sound/audio-related debug messages.

StreamManagerDebug 

RESERVED

SystemLog 

RESERVED

◆ TerminalColor

enum TerminalColor
strong

Enumerator listing all possible terminal colors.

While the BlamBasicLogger does not support terminal output natively, applications which use it may wish to implement more complex terminal formatting - using colors.

Enumerator
Black 
Blue 
Green 
Cyan 
Red 
Magenta 
Gold 
Gray 
DarkGray 
BrightBlue 
BrightGreen 
BrightCyan 
BrightRed 
BrightMagenta 
Yellow 
White 
Reset