Twoorb Plugins  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Twoorb.Utilities.Logger Class Reference

A custom logger class to be used in the game developer process. Provides a custom GUI, save log to disc and report issue by mail ability as well as crash detection. Use the Initialize()-method to set up. To enable mail-support - use the InitializeEMail()-method. More...

Inheritance diagram for Twoorb.Utilities.Logger:

Public Types

enum  EConsoleButtonAnchor { EConsoleButtonAnchor.TopLeft, EConsoleButtonAnchor.TopRight, EConsoleButtonAnchor.BottomRight, EConsoleButtonAnchor.BottomLeft }
 Enum used to specify the anchored position of the debug button of the logger GUI. More...
 

Public Member Functions

void Setup ()
 Setups the the logger object More...
 
void Log (string message, LogType messageType, string stackTrace=null)
 Logs a message to the Loggers list of messages. This message will be included in any logs you decide to save or send. More...
 

Static Public Member Functions

static void Initialize (EConsoleButtonAnchor buttonAnchor=EConsoleButtonAnchor.BottomLeft, bool continuousLogging=false, bool saveCompleteLog=true, bool showGUI=true, bool saveAllStackTraces=false)
 Initializes the logger and enables the runtime debug GUI. More...
 
static bool InitializeEMail (string url, string from, string to)
 Initializes the email feature of the log. This will enable you to report and send logs to a specified mail account. More...
 
static void Log (string message)
 Logs a message to the Logger instance More...
 
static void LogError (string message)
 Logs an error message to the Logger instance. More...
 
static void LogException (Exception ex)
 Logs an exception to the Logger instance More...
 
static void LogWarning (string message)
 Logs a warning to the logger instance. More...
 
static List< LogMessageGetLog ()
 Returns a copy of the list with log messages. If there is no log initialized, it will return null. More...
 

Static Public Attributes

static bool ShowGUI = true
 Completely enables/ disables the GUI drawing of the logging object. More...
 
static bool SaveCompleteLog = true
 Decides if the complete log will be logged and saved(in memory). If this is false, the log will start to delete old log messages if the count is more than MaxMessages More...
 
static bool SaveAllStackTraces = false
 Sets if you should save stack traces to the log for all types of messages. If false, it will only save traces for Errors and Exceptions More...
 
static bool ContinuousLogging = false
 Crash detection. If continuous logging is enabled, The system will continuously log everything that happens to a file and removes it when the application ends. If the log is still apparent when opening up the app again, it's very likely that a crash occured. If you have email support initialized, a prompt to send the crash log will automatically appear. More...
 
static int MaxMessages = 100
 If SaveCompleteLog is false, the logger will cap the maximum amount of log messages to this number. More...
 

Properties

static bool HasInstance [get]
 Returns if an instance of the logger is currently available. More...
 
static Logger Instance [get]
 Returns an instance of the logger. One will be created if there is none available. It calls DontDestroyOnLoad on the created object. More...
 
List< LogMessageMessages [get]
 Returns a copy of the list with log messages. Creates a new list every time. More...
 
EConsoleButtonAnchor ButtonAnchor [get, set]
 Gets or sets where the Show/Hide debug window button should be anchored. More...
 
bool MailIsInitialized [get]
 Returns whether or not the mail initialization method has been called. This is not an indicator that it has been properly initialized, just that it was called. More...
 
Mailer Mailer [get, set]
 Gets or sets the Mailer object of this class. This is the instance that handles the email sending of logs More...
 
string From [get, set]
 Gets or sets the "from"-address that will be used when sending emails. More...
 
string To [get, set]
 Gets or sets the email that you will be sending the logs to. More...
 

Detailed Description

A custom logger class to be used in the game developer process. Provides a custom GUI, save log to disc and report issue by mail ability as well as crash detection. Use the Initialize()-method to set up. To enable mail-support - use the InitializeEMail()-method.

Member Enumeration Documentation

Enum used to specify the anchored position of the debug button of the logger GUI.

Enumerator
TopLeft 

Top left

TopRight 

Top right

BottomRight 

Bottom right

BottomLeft 

Bottom left

Member Function Documentation

static List<LogMessage> Twoorb.Utilities.Logger.GetLog ( )
static

Returns a copy of the list with log messages. If there is no log initialized, it will return null.

static void Twoorb.Utilities.Logger.Initialize ( EConsoleButtonAnchor  buttonAnchor = EConsoleButtonAnchor.BottomLeft,
bool  continuousLogging = false,
bool  saveCompleteLog = true,
bool  showGUI = true,
bool  saveAllStackTraces = false 
)
static

Initializes the logger and enables the runtime debug GUI.

Parameters
buttonAnchorGets or sets where the Show/Hide debug window button should be anchored.
continuousLoggingCrash detection. If continuous logging is enabled, The system will continuously log everything that happens to a file and removes it when the application ends. If the log is still apparent when opening up the app again, it's very likely that a crash occured. If you have email support initialized, a prompt to send the crash log will automatically appear.
saveCompleteLogIf SaveCompleteLog is false, the logger will cap the maximum amount of log messages to this number.
showGUICompletely enables/ disables the GUI drawing of the logging object.
saveAllStackTracesSets if you should save stack traces to the log for all types of messages. If false, it will only save traces for Errors and Exceptions
static bool Twoorb.Utilities.Logger.InitializeEMail ( string  url,
string  from,
string  to 
)
static

Initializes the email feature of the log. This will enable you to report and send logs to a specified mail account.

Parameters
urlThe url to the php-file that will remotely handle the sending of emails.
fromThe "from"-address that will be used when sending emails
toThe email that you will be sending the logs to.
Returns
void Twoorb.Utilities.Logger.Log ( string  message,
LogType  messageType,
string  stackTrace = null 
)

Logs a message to the Loggers list of messages. This message will be included in any logs you decide to save or send.

Parameters
messageThe message to log
messageTypeThe type of message.
stackTraceAn optional stack trace to the log message. Will only be saved if type is Error or Exception, unless SaveAllStackTraces is true
static void Twoorb.Utilities.Logger.Log ( string  message)
static

Logs a message to the Logger instance

Parameters
messageThe message to log
static void Twoorb.Utilities.Logger.LogError ( string  message)
static

Logs an error message to the Logger instance.

Parameters
messageThe message to log
static void Twoorb.Utilities.Logger.LogException ( Exception  ex)
static

Logs an exception to the Logger instance

Parameters
exThe exception to log. Exception.Message will be used to log the exception.
static void Twoorb.Utilities.Logger.LogWarning ( string  message)
static

Logs a warning to the logger instance.

Parameters
messageThe message to log.
void Twoorb.Utilities.Logger.Setup ( )

Setups the the logger object

Member Data Documentation

bool Twoorb.Utilities.Logger.ContinuousLogging = false
static

Crash detection. If continuous logging is enabled, The system will continuously log everything that happens to a file and removes it when the application ends. If the log is still apparent when opening up the app again, it's very likely that a crash occured. If you have email support initialized, a prompt to send the crash log will automatically appear.

int Twoorb.Utilities.Logger.MaxMessages = 100
static

If SaveCompleteLog is false, the logger will cap the maximum amount of log messages to this number.

bool Twoorb.Utilities.Logger.SaveAllStackTraces = false
static

Sets if you should save stack traces to the log for all types of messages. If false, it will only save traces for Errors and Exceptions

bool Twoorb.Utilities.Logger.SaveCompleteLog = true
static

Decides if the complete log will be logged and saved(in memory). If this is false, the log will start to delete old log messages if the count is more than MaxMessages

bool Twoorb.Utilities.Logger.ShowGUI = true
static

Completely enables/ disables the GUI drawing of the logging object.

Property Documentation

EConsoleButtonAnchor Twoorb.Utilities.Logger.ButtonAnchor
getset

Gets or sets where the Show/Hide debug window button should be anchored.

string Twoorb.Utilities.Logger.From
getset

Gets or sets the "from"-address that will be used when sending emails.

bool Twoorb.Utilities.Logger.HasInstance
staticget

Returns if an instance of the logger is currently available.

Logger Twoorb.Utilities.Logger.Instance
staticget

Returns an instance of the logger. One will be created if there is none available. It calls DontDestroyOnLoad on the created object.

Mailer Twoorb.Utilities.Logger.Mailer
getset

Gets or sets the Mailer object of this class. This is the instance that handles the email sending of logs

bool Twoorb.Utilities.Logger.MailIsInitialized
get

Returns whether or not the mail initialization method has been called. This is not an indicator that it has been properly initialized, just that it was called.

List<LogMessage> Twoorb.Utilities.Logger.Messages
get

Returns a copy of the list with log messages. Creates a new list every time.

string Twoorb.Utilities.Logger.To
getset

Gets or sets the email that you will be sending the logs to.


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