CatDebugInstance Class Reference

Instanced Version of CatDebug. Create an new instance of this class when you want to log in a separate thread and use it's own prepend/append values.

Public Member Functions

 CatDebugInstance ()
 Default constructor, blank string is assigned to instance name.
 
 CatDebugInstance (string instanceName)
 Constructor assigns the provided string to instance name, and enables the prependInstanceName flag.
 
void AppendToNextLog (int category, params object[] messageObjects)
 This function will store the provided text, and append it to the text of the next call to a Log function. When finally displayed by a Log function, the append-text will be reset to an empty string. This text is not append to error, exception or warning logs. Calling this function multiple times, will grow the prepend text, by appending the passed message to it.
 
void AppendToNextLog (int category, string message)
 This function will store the provided text, and append it to the text of the next call to a Log function. When finally displayed by a Log function, the append-text will be reset to an empty string. This text is not append to error, exception or warning logs. Calling this function multiple times, will grow the prepend text, by appending the passed message to it.
 
void AppendToNextLog (string message)
 This function will store the provided text, and associate it with the provided category. However, if all logging for the category is disabled: the function will return immediately, and do nothing. The text will then be prepend to the text of the next call of a Log function with the same category. After be drawn in a log call the append text, for that category, will be cleared. This text is not append to error, exception or warning logs. Calling this function multiple times, will grow the prepend text, by appending the passed message to it.
 
void ClearAppendText ()
 Clears the prepend text used when no category is provided.
 
void ClearAppendText (int category)
 Clears the prepend text for the provided category, if any exists.
 
void ClearPrependText ()
 Clears the prepend text used when no category is provided.
 
void ClearPrependText (int category)
 Clears the prepend text for the provided category, if any exists.
 
void Log (int category, params object[] message)
 This function will take an array of strings, and if the specified category is enabled, and if a DEBUG build is running, it will concatenate together the strings and send the result to Debug.Log for display. The advantage to passing a comma separated array of strings, rather than a single preformed string, is that concatenation can be avoided, when unnecessary. If addCategoryNameToLog is true, the category name will be prepended to the final string before sending it to Debug.Log
 
void Log (int category, string message)
 This function will take a single string, and if the category is enabled, and if a DEBUG build is running, it will send it to Debug.Log for display. If addCategoryNameToLog is true, the category name will be prepended to the final string before sending it to Debug.Log
 
void Log (string categoryName, params object[] message)
 This function takes a set of strings as parameters and uses the first one as the category, the rest are part of the message to be displayed. The message is only displayed if the Category has been registered, and is enabled
 
void Log (string message)
 This function will take an array of strings, and if a DEBUG build is running, it will concatenate together the strings and send the result to Debug.Log for display.
 
void PrependToNextLog (int category, params object[] messageObjects)
 This function will store the provided text, and associate it with the provided category. However, if all logging for the category is disabled: the function will return immediately, and do nothing. The text will then be prepend to the text of the next call of a Log function with the same category. After be drawn in a log call the prepend text, for that category, will be cleared. This text is not prepended to error, exception or warning logs. Calling this function multiple times, will grow the prepend text, by appending the passed message to it.
 
void PrependToNextLog (int category, string message)
 This function will store the provided text, and associate it with the provided category. However, if all logging for the category is disabled: the function will return immediately, and do nothing. The text will then be prepend to the text of the next call of a Log function with the same category. After be drawn in a log call the prepend text, for that category, will be cleared. This text is not prepended to error, exception or warning logs. Calling this function multiple times, will grow the prepend text, by appending the passed message to it.
 
void PrependToNextLog (string message)
 This function will store the provided text, and prepend it to the text of the next call to a Log function. When finally displayed by a Log function, the prepend text will be reset to an empty string. This text is not prepended to error, exception or warning logs. Calling this function multiple times, will grow the prepend text, by appending the passed message to it.
 

Public Attributes

string instanceName
 Name assigned to this instance, for potential display. By default instances will have a blank string for the name. Uniqueness of names is not checked, nor required (but it is recommended for most use-cases).
 
bool prependInstanceName
 Controls weather or not the instanceName will be included Log messages, at the start of the message. Note: if the category is also being displayed, the instance name will after the category in the output message.
 
bool prependInstanceNameSingleLine
 When single-line false, a newline will be included in the log, after the instance name. When true, it will not add a newline.