/** * Method to write to the log * * @param array $logEntry * @param array $options * @return \Pop\Log\Writer\Mail */ public function writeLog(array $logEntry, array $options = array()) { $subject = isset($options['subject']) ? $options['subject'] : 'Log Entry:'; $subject .= ' ' . $logEntry['name'] . ' (' . $logEntry['priority'] . ')'; $mail = new \Pop\Mail\Mail($subject, $this->emails); if (isset($options['headers'])) { $mail->setHeaders($options['headers']); } $entry = implode("\t", $logEntry) . PHP_EOL; $mail->setText($entry)->send(); return $this; }
/** * Write to a custom log * * @param string $content * @return Mail */ public function writeCustomLog($content) { $subject = isset($this->options['subject']) ? $this->options['subject'] : 'Custom Log Entry'; $mail = new \Pop\Mail\Mail($subject, $this->emails); if (isset($this->options['headers'])) { $mail->setHeaders($this->options['headers']); } $mail->setText($content . PHP_EOL)->send(); return $this; }