Logging
- public function __construct($file, $format) — Create a new log entry, which will be written later. The format string should use "%x"-style placeholders to represent data which will be added later:
- public function setData($map) — Add data to the log. Provide a map of variables to replace in the format string. For example, if you use a format string like:
- public function getData($key, $default) — Get existing log data.
- public function setFile($file) — Set the path where the log will be written. You can pass `null` to prevent the log from writing.
Writing the Log
- public function __destruct() — When the log object is destroyed, it writes if it hasn't written yet.
- public function write() — Write the log explicitly, if it hasn't been written yet. Normally you do not need to call this method; it will be called when the log object is destroyed. However, you can explicitly force the write earlier by calling this method.
Internals
Other Methods
- public function getFile()
- public function setFailQuietly($fail_quietly) — Set quiet (logged) failure, instead of the default loud (exception) failure. Throwing exceptions from destructors which exit at the end of a request can result in difficult-to-debug behavior.
internals
- private function format() — Format the log string, replacing "%x" variables with values.