Skip to content

Conversation

@joaopedroxavier
Copy link
Contributor

Changes

This PR expands the zerolog usage in the repository, as it was only being used in the app instance and the general console logging was being made by standard fmt.Println() calls.

Now we have extended the error interface for some structs that represent typed errors, and created Info() functions for typed log messages.

How can I test it?

  • go build .
  • ./dont-panic-api.exe
  • make some requests in postman and check the logs in the console.

Examples

TODO

As mentioned with @rebecacalazans, we should implement logging to Azure Portal too. I plan to do that later.

Comment on lines +12 to +14
failedToDecodeJSONMessage = LogEvent{1005, "Failed to parse JSON into %s.\n"}
failedToEncodeJSONMessage = LogEvent{1006, "Failed to encode %s into JSON format.\n"}
failedToExecuteGremlinQueryMessage = LogEvent{1007, "Failed to execute Gremlin query.\n"}
Copy link
Member

Choose a reason for hiding this comment

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

Aren't these errors too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants