1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-23 04:47:02 +00:00

formatting

Former-commit-id: 037081db5d6d4434e873ca8b75334ee43e046b6a
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-08-17 10:06:20 +03:00
parent 00967408dc
commit 07046ab978
112 changed files with 477 additions and 517 deletions

View File

@@ -41,7 +41,7 @@ func (l *requestLoggerMiddleware) ServeHTTP(ctx context.Context) {
}
}
//all except latency to string
// all except latency to string
var status, ip, method, path string
var latency time.Duration
var startTime, endTime time.Time
@@ -49,7 +49,7 @@ func (l *requestLoggerMiddleware) ServeHTTP(ctx context.Context) {
ctx.Next()
//no time.Since in order to format it well after
// no time.Since in order to format it well after
endTime = time.Now()
latency = endTime.Sub(startTime)
@@ -126,7 +126,6 @@ func (l *requestLoggerMiddleware) ServeHTTP(ctx context.Context) {
// Columnize formats the given arguments as columns and returns the formatted output,
// note that it appends a new line to the end.
func Columnize(nowFormatted string, latency time.Duration, status, ip, method, path string, message interface{}, headerMessage interface{}) string {
titles := "Time | Status | Latency | IP | Method | Path"
line := fmt.Sprintf("%s | %v | %4v | %s | %s | %s", nowFormatted, status, latency, ip, method, path)
if message != nil {