Advanced Logger v1.0.1
Logger
Loading...
Searching...
No Matches
ULoggerSubsystem Class Reference

Subsystem class for logging messages in the console and on the screen. More...

#include <LoggerSubsystem.h>

Public Member Functions

virtual void Log (const UObject *InContextObject, FString InMessage=TEXT("Log Message"), int32 InKey=1, float InTime=5.0f, bool bConsoleLog=false)
 Logs a message to the screen and optionally to the console.
 
virtual void Warning (const UObject *InContextObject, FString InMessage=TEXT("Warning Message"), int32 InKey=2, float InTime=5.0f, bool bConsoleLog=false)
 Logs a warning message to the screen and optionally to the console.
 
virtual void Error (const UObject *InContextObject, FString InMessage=TEXT("Error Message"), int32 InKey=3, float InTime=5.0f, bool bConsoleLog=false)
 Logs an error message to the screen and optionally to the console.
 
virtual void ScreenMessage (const UObject *InContextObject, FString InMessage=FString(TEXT("Screen message")), int32 InKey=1, FLinearColor InColor=FLinearColor(255, 255, 255, 255), float InTime=5.0f)
 Displays a message on the screen with a specified color and duration.
 
virtual void ConsoleLog (const UObject *InContextObject, FString InMessage=FString(TEXT("Console message")), EConsoleColor InColor=EConsoleColor::COLOR_NONE)
 Logs a message to the console with a specified color.
 

Protected Member Functions

virtual void SetConsoleColor (EConsoleColor InColor=EConsoleColor::COLOR_NONE)
 Sets the console text color.
 
virtual const class ULoggerSettingsGetSettings () const
 Gets default object for ULoggerSettings.
 

Detailed Description

Subsystem class for logging messages in the console and on the screen.

This class provides methods to log messages at various levels (Log, Warning, Error) both on the screen and in the console with specific colors.

Member Function Documentation

◆ ConsoleLog()

virtual void ULoggerSubsystem::ConsoleLog ( const UObject * InContextObject,
FString InMessage = FString(TEXT("Console message")),
EConsoleColor InColor = EConsoleColor::COLOR_NONE )
virtual

Logs a message to the console with a specified color.

Parameters
InContextObjectThe context object, typically the calling UObject.
InMessageThe message to log to the console. Defaults to "Console message".
InColorThe color of the console message. Defaults to EConsoleColor::COLOR_NONE.

◆ Error()

virtual void ULoggerSubsystem::Error ( const UObject * InContextObject,
FString InMessage = TEXT("Error Message"),
int32 InKey = 3,
float InTime = 5.0f,
bool bConsoleLog = false )
virtual

Logs an error message to the screen and optionally to the console.

Parameters
InContextObjectThe context object, typically the calling UObject.
InMessageThe error message to log. Defaults to "Error Message".
InKeyThe key for the on-screen message. Defaults to 3.
InTimeThe duration the message stays on the screen. Defaults to 5.0f seconds.
bConsoleLogIf true, logs the error message to the console as well. Defaults to false.

◆ GetSettings()

virtual const class ULoggerSettings * ULoggerSubsystem::GetSettings ( ) const
protectedvirtual

Gets default object for ULoggerSettings.

See also
ULoggerSettings

◆ Log()

virtual void ULoggerSubsystem::Log ( const UObject * InContextObject,
FString InMessage = TEXT("Log Message"),
int32 InKey = 1,
float InTime = 5.0f,
bool bConsoleLog = false )
virtual

Logs a message to the screen and optionally to the console.

Parameters
InContextObjectThe context object, typically the calling UObject.
InMessageThe message to log. Defaults to "Log Message".
InKeyThe key for the on-screen message. Defaults to 1.
InTimeThe duration the message stays on the screen. Defaults to 5.0f seconds.
bConsoleLogIf true, logs the message to the console as well. Defaults to false.

◆ ScreenMessage()

virtual void ULoggerSubsystem::ScreenMessage ( const UObject * InContextObject,
FString InMessage = FString(TEXT("Screen message")),
int32 InKey = 1,
FLinearColor InColor = FLinearColor(255, 255, 255, 255),
float InTime = 5.0f )
virtual

Displays a message on the screen with a specified color and duration.

Parameters
InContextObjectThe context object, typically the calling UObject.
InMessageThe message to display. Defaults to "Screen message".
InKeyThe key for the on-screen message. Defaults to 1.
InColorThe color of the on-screen message. Defaults to white (FColor(255, 255, 255, 255)).
InTimeThe duration the message stays on the screen. Defaults to 5.0f seconds.

◆ SetConsoleColor()

virtual void ULoggerSubsystem::SetConsoleColor ( EConsoleColor InColor = EConsoleColor::COLOR_NONE)
protectedvirtual

Sets the console text color.

Parameters
InColorThe color to set the console text to. Defaults to EConsoleColor::COLOR_NONE.

◆ Warning()

virtual void ULoggerSubsystem::Warning ( const UObject * InContextObject,
FString InMessage = TEXT("Warning Message"),
int32 InKey = 2,
float InTime = 5.0f,
bool bConsoleLog = false )
virtual

Logs a warning message to the screen and optionally to the console.

Parameters
InContextObjectThe context object, typically the calling UObject.
InMessageThe warning message to log. Defaults to "Warning Message".
InKeyThe key for the on-screen message. Defaults to 2.
InTimeThe duration the message stays on the screen. Defaults to 5.0f seconds.
bConsoleLogIf true, logs the warning message to the console as well. Defaults to false.

The documentation for this class was generated from the following file: