Debug::log PHP Метод

log() публичный Метод

Writes log info to a file
public log ( $msg, $path = "" ) : null
$msg string the message to write out
$path string the location to write the messages
Результат null
    function log($msg, $path = "")
    {
        if (empty($path)) {
            $path = dirname(__FILE__) . "/../tmp/debug/";
            $path = MF_FILES_PATH;
        }
        if (!is_string($msg)) {
            $msg = print_r($msg, true);
        }
        $fp = fopen($path . 'magic_fields.log', 'a+');
        $date = gmdate('Y-m-d H:i:s');
        fwrite($fp, "{$date} - {$msg}\n");
        fclose($fp);
    }

Usage Example

Пример #1
0
 public function flagAsPaid($itemExpenseId)
 {
     Debug::log('Flagging as paid...');
     $data = array('isFullyPaid' => 1);
     $this->db->update('ItemExpense', $data, array('itemExpenseId' => $itemExpenseId));
     Debug::log($this->db->last_query());
 }
All Usage Examples Of Debug::log
Debug