![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The console printing class.
The console prints to std::printf or ANDROID_LOG_INFO.
The console class has serveral static methods to print without a class context e.g. System::Console::Print().
An instance of the console class can print three levels:
Printing a message supports:
The output string is: [global prefix]" "[indent string][level prefix]" "[message].
Definition of the print levels. Use GetLevel() to get the current level.
Murl.System.Console.QUIET | Do not print. |
Murl.System.Console.ERROR | Print errors only. |
Murl.System.Console.WARNING | Print errors and warnings. |
Murl.System.Console.INFO | Print errors, warnings and infos. |
Murl.System.Console.MAX_LEVELS |
Print a string.
message | The message string to print. |
Print a string including an end-of-line character at the end of the string.
Boolean PrintEndline(String message)
message | The message string to print. |
Print the hex dump of a data object.
Boolean PrintHex(Murl.ConstData data, Integer bytesPerLine)
data | The data object to print. |
bytesPerLine | The the number of source bytes per line. |
The default constructor.
Murl.System.Console new()
Constructor taking a global prefix string.
Murl.System.Console new(String globalPrefix)
globalPrefix | The global prefix string. |
Set the current print level.
Boolean SetLevel(Murl.System.Console.Level level)
level | The current print level. |
Get the current print level.
Murl.System.Console.Level GetLevel()
Set the number of indent characters per section. The default number of indent characters is 2. The indent string contains the indent character (GetIndentWidth() * GetCurrentSection()) times. The indent string is printed for each message.
SetIndentWidth(Integer indentWidth)
indentWidth | The number of indent characters per section, a width of zero disables indentation. |
Get the number of indent characters per section.
Integer GetIndentWidth()
Set the indent character. The default indent character is a space. The indent string contains the indent character (GetIndentWidth() * GetCurrentSection()) times. The indent string is printed for each message.
SetIndentChar(Char indentChar)
indentChar | The indent character. |
Get the indent character.
Char GetIndentChar()
Set the global prefix string. The global prefix string is printed for each message including a trailing space character.
SetGlobalPrefix(String prefix)
prefix | The global prefix string. |
Get the global prefix string.
String GetGlobalPrefix()
Set the info prefix string. The info prefix string is printed for info messages including a trailing space character.
SetInfoPrefix(String prefix)
prefix | The info prefix string. |
Get the info prefix string.
String GetInfoPrefix()
Set the warning prefix string. The warning prefix string is printed for warning messages including a trailing space character.
SetWarningPrefix(String prefix)
prefix | The warning prefix string. |
Get the warning prefix string.
String GetWarningPrefix()
Set the error prefix string. The error prefix string is printed for error messages including a trailing space character.
SetErrorPrefix(String prefix)
prefix | The error prefix string. |
Get the error prefix string.
String GetErrorPrefix()
Get the current section. The currend section is incremented by BeginInfo() and decremented by EndInfo(). The current section is used for indentation only, see SetIndentChar() and SetIndentWidth().
Integer GetCurrentSection()
Get the current indent string. The indent string contains the indent character (GetIndentWidth() * GetCurrentSection()) times. The indent string is printed for each message.
String GetCurrentIndentString()
Begin a section. Increments the current section.
Boolean BeginSection()
Begin a section and print a string. The message is printed before incrementing the current section.
Boolean BeginSection(String message)
message | The message string to print. |
End a section. Decrements the current section.
Boolean EndSection()
End a section and print a string. The message is printed after decrementing the current section.
Boolean EndSection(String message)
message | The message string to print. |
Print a string at info level.
Boolean PrintInfo(String message)
message | The message string to print. |
Print a string at warning level.
Boolean PrintWarning(String message)
message | The message string to print. |
Print a string at error level.
Boolean PrintError(String message)
message | The message string to print. |