From d5367b15f260d1a91a53559bfc8d6e5121228baa Mon Sep 17 00:00:00 2001 From: sairoutine Date: Fri, 7 Dec 2018 19:07:37 +0900 Subject: [PATCH] Add comment --- logger.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/logger.go b/logger.go index cd29209b..be4870f0 100644 --- a/logger.go +++ b/logger.go @@ -26,6 +26,7 @@ var ( disableColor = false ) +// LoggerConfig defines the config for Logger middleware. type LoggerConfig struct { // Optional. Default value is gin.DefaultLogFormatter Formatter LogFormatter @@ -55,6 +56,7 @@ type LogFormatterParams struct { IsTerm bool } +// DefaultLogFormatter is the default log format function Logger middleware uses. var DefaultLogFormatter = func(param LogFormatterParams) string { var statusColor, methodColor, resetColor string if param.IsTerm { @@ -117,6 +119,7 @@ func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc { }) } +// LoggerWithConfig instance a Logger middleware with config. func LoggerWithConfig(conf LoggerConfig) HandlerFunc { formatter := conf.Formatter if formatter == nil {