Skip to content

Commit

Permalink
pass message to the timestamp function
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Mar 21, 2024
1 parent a53d0e7 commit 655727a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/shared/log/to-console.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function toConsole(log, opts, translate) {
// Get message and timestamp before printing anything to avoid
// logging a half message if there's an error in one of them
var message = translate.message(msg, data);
var timestamp = translate.timestamp();
var timestamp = translate.timestamp(msg, data);

if (message) {
// Ensure timestamp is not written without a message
Expand All @@ -63,8 +63,8 @@ function toConsole(log, opts, translate) {
function onWarn(msg, data) {
// Get message and timestamp before printing anything to avoid
// logging a half message if there's an error in one of them
var timestamp = translate.timestamp();
var message = translate.message(msg, data);
var timestamp = translate.timestamp(msg, data);

if (message) {
// Ensure timestamp is not written without a message
Expand All @@ -78,8 +78,8 @@ function toConsole(log, opts, translate) {
function onInfo(msg, data) {
// Get message and timestamp before printing anything to avoid
// logging a half message if there's an error in one of them
var timestamp = translate.timestamp();
var message = translate.message(msg, data);
var timestamp = translate.timestamp(msg, data);

if (message) {
// Ensure timestamp is not written without a message
Expand All @@ -93,8 +93,8 @@ function toConsole(log, opts, translate) {
function onDebug(msg, data) {
// Get message and timestamp before printing anything to avoid
// logging a half message if there's an error in one of them
var timestamp = translate.timestamp();
var message = translate.message(msg, data);
var timestamp = translate.timestamp(msg, data);

if (message) {
// Ensure timestamp is not written without a message
Expand Down

0 comments on commit 655727a

Please sign in to comment.