fi_console

Handle logging to the console log

int IsATTY();

Return true if console is a TTY

string GetConsoleASCIIEscape();

Return the famous “e” aka “’033”

string GetConsoleColorString(string sString, string sConsoleColor);
Parameters:
  • sString – String to colorize

  • sConsoleColor – A CONSOLE_COLOR_*

Returns:

Colorized string

Return a Linux shell color control code CONSOLE_COLOR_* if TTY, otherwise return the uncolored string.

void ConsoleClearScreen();

Clear the screen

void WriteTimestampedLogEntryEx(string sPrefix, string sLogEntry, string sConsoleColor = CONSOLE_COLOR_NONE);
Parameters:
  • sPrefix – Add this prefix to the string

  • sLogEntry – Print this log entry

  • sConsoleColor – A CONSOLE_COLOR_*

Write sLogEntry as a timestamped entry into the log file.

void LogDebug(string sLogEntry, string sConsoleColor = CONSOLE_COLOR_BLUE);
Parameters:
  • sLogEntry – Print this log entry

  • sConsoleColor – A CONSOLE_COLOR_*

Write sLogEntry as a timestamped entry into the log file.

void LogInfo(string sLogEntry, string sConsoleColor = CONSOLE_COLOR_NONE);
Parameters:
  • sLogEntry – Print this log entry

  • sConsoleColor – A CONSOLE_COLOR_*

Write sLogEntry as a prefixed timestamped entry into the log file.

void LogNotice(string sLogEntry, string sConsoleColor = CONSOLE_COLOR_GREEN);
Parameters:
  • sLogEntry – Print this log entry

  • sConsoleColor – A CONSOLE_COLOR_*

Write sLogEntry as a prefixed timestamped entry into the log file, in color.

void LogWarning(string sLogEntry, string sConsoleColor = CONSOLE_COLOR_YELLOW);
Parameters:
  • sLogEntry – Print this log entry

  • sConsoleColor – A CONSOLE_COLOR_*

Write sLogEntry as a prefixed timestamped entry into the log file, in color.

void LogError(string sLogEntry, string sConsoleColor = CONSOLE_COLOR_RED);
Parameters:
  • sLogEntry – Print this log entry

  • sConsoleColor – A CONSOLE_COLOR_*

Write sLogEntry as a prefixed timestamped entry into the log file, in color.

void LogFatal(string sLogEntry);
Parameters:
  • sLogEntry – Print this log entry

  • sConsoleColor – A CONSOLE_COLOR_*

Write sLogEntry as a prefixed timestamped entry into the log file, in color; then shutdown.