The framework supports logging. When your app is in debug mode a logfile will automatically be created inside the /app/logs directory. Log content will be stored in text files per day.

Use the addLog() function in order to log to the buffer.

function addLog($type, $line);

You can use different log types:

  • ASATRU_LOG_INFO: An information message
  • ASATRU_LOG_DEBUG: A debug message
  • ASATRU_LOG_WARNING: A warning message
  • ASATRU_LOG_ERROR: An error message

An example log content can log like the following:

[2020-02-1 03:02:17 pm][Header] Asatru PHP log on 2020-02-1 03:02:17 pm
[2020-02-1 03:02:17 pm][Info] TestCase Info
[2020-02-1 03:02:17 pm][Debug] TestCase Debug
[2020-02-1 03:02:17 pm][Warning] TestCase Warning
[2020-02-1 03:02:17 pm][Error] TestCase Error

In order to clean the current log buffer use

function clearLog();

In order to force storing the current log buffer use

function storeLog();
© 2021 by Daniel Brendel - all rights reserved