Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Mailer] Add timestamp to SMTP debug log
  • Loading branch information
bytestream authored and fabpot committed Feb 4, 2024
commit 53a637c381056a134b4902f2ad116d2ebc9a9178
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ abstract class AbstractStream
public function write(string $bytes, bool $debug = true): void
{
if ($debug) {
$timestamp = date('c');
foreach (explode("\n", trim($bytes)) as $line) {
$this->debug .= sprintf("> %s\n", $line);
$this->debug .= sprintf("[%s] > %s\n", $timestamp, $line);
}
}

Expand Down Expand Up @@ -91,7 +92,7 @@ public function readLine(): string
}
}

$this->debug .= sprintf('< %s', $line);
$this->debug .= sprintf('[%s] < %s', date('c'), $line);

return $line;
}
Expand Down