Skip to content

Commit f1d5eb0

Browse files
committed
Add improvements comments
1 parent c406c42 commit f1d5eb0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/php-bufflog/BuffLog.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,16 @@ private function formatLog($message, $level, $context = [], $extra = [])
5959
"message" => $message,
6060
"level" => $level,
6161
"datetime" => date(\DateTime::ATOM),
62+
// we could use timestamp if we need ms precision (but it isn't readable) https://docs.datadoghq.com/logs/processing/#reserved-attributes
63+
// 'timestamp' => round(microtime(true) * 1000),
6264
"context" => $context,
6365
"extra" => $extra
6466
];
6567

6668
try {
6769
$output = json_encode($output, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
6870
} catch (Exception $e) {
69-
error_log("can't log your message");
71+
error_log("can't json_encode your message");
7072
}
7173

7274
return $output;

0 commit comments

Comments
 (0)