gologrus

Log prints different outputs


I'm having problems with the output of my log messages. I'm using logrus.

I'm developing with VS Code and when I debug my code the log output is:

time="2021-05-04T11:52:11+01:00" level=info msg=message

But when I'm running the app executable or use go run main.go the output is:

INFO[0007] message  

I want the first output.

What is happening?

EDIT:

We need to set the formatter as stated in the logrus github.


Solution

  • We need to set the formatter as stated in the logrus github