Reality Logger

From Refractor 2 - Technical Information Wiki
Revision as of 20:33, 7 January 2025 by BftechAdmin (talk | contribs) (Created page with "The Reality Logger is used to easily log to a file. ==Creating a logger== <code>realitylogger.createLogger( name, path, fileName, continous )</code> * name - a unique key used to select the logger * Path - Diretory the log file gets created in * FileName - Name of the file created. If not contionous should specify a date format (strftime format) * Continous - Whether to log to one file all the time or create new one every round createLogger may be called many times w...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The Reality Logger is used to easily log to a file.

Creating a logger

realitylogger.createLogger( name, path, fileName, continous )

  • name - a unique key used to select the logger
  • Path - Diretory the log file gets created in
  • FileName - Name of the file created. If not contionous should specify a date format (strftime format)
  • Continous - Whether to log to one file all the time or create new one every round


createLogger may be called many times with the same key, repeating calls will be properly filtered out. It is not required to put it in an init() function.


Using a logger

To acquire a logger: X = realitylogger.RealityLogger[key]

Basic logging commands:

X.logLine(line)

X.logLines(lines)