Skip to content

Feat: added console writer for local logging#123

Merged
guacamole merged 3 commits intomasterfrom
pretty-logger
Mar 26, 2022
Merged

Feat: added console writer for local logging#123
guacamole merged 3 commits intomasterfrom
pretty-logger

Conversation

@guacamole
Copy link
Member

  • pretty and readable logging for local debugging

@guacamole guacamole requested a review from jay-dee7 March 26, 2022 13:28
@guacamole guacamole self-assigned this Mar 26, 2022
e.Errors = append(e.Errors, err)
}
} else {
_, err = buf.WriteString(color.RedString(" %d", res.Status))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guacamole can we do yellow for warn and red for error?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also can we please move status up? like right after we calculate log level?

e.Errors = append(e.Errors, err)
}

_, err = buf.WriteString(req.Method + " ")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guacamole print method field before host

@jay-dee7 jay-dee7 added enhancement New feature or request P2 P2 labels are used for significant features, improvements, etc labels Mar 26, 2022
@jay-dee7 jay-dee7 added this to the Logs and Monitoring milestone Mar 26, 2022
@jay-dee7 jay-dee7 linked an issue Mar 26, 2022 that may be closed by this pull request
zerolog.SetGlobalLevel(zerolog.DebugLevel)
return l
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guacamole can we remove this ZerologMiddleware? we don't use it anymore

- this way the handlers don't have to ctx.Set the error key each time and thus removing a bunch of repeated codes
Copy link
Member

@jay-dee7 jay-dee7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guacamole LGTM 🥇 🥇 🥇

@guacamole guacamole merged commit b67ac6c into master Mar 26, 2022
@guacamole guacamole deleted the pretty-logger branch March 26, 2022 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request P2 P2 labels are used for significant features, improvements, etc

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Print JSON logs only in debug mode

2 participants