Skip to content

Instantly share code, notes, and snippets.

@dhruvr
Created September 21, 2019 21:38
Show Gist options
  • Select an option

  • Save dhruvr/1654f478ec6cf22425a285fd1ddf93e9 to your computer and use it in GitHub Desktop.

Select an option

Save dhruvr/1654f478ec6cf22425a285fd1ddf93e9 to your computer and use it in GitHub Desktop.

Revisions

  1. dhruvr created this gist Sep 21, 2019.
    13 changes: 13 additions & 0 deletions logurwriter.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    func ConfigureLogrus(output io.Writer) *logrus.Logger {
    logger := logrus.New()
    logger.SetLevel(logrus.DebugLevel)
    logger.SetFormatter(&logrus.TextFormatter{
    DisableColors: false,
    FullTimestamp: true,
    TimestampFormat: "2006-01-02 15:04:05.000",
    ForceColors: true,
    DisableLevelTruncation: true,
    })
    logger.SetOutput(output)
    return logger
    }