Merge pull request #98 from aaronlehmann/logs-padding-underflow
service: Avoid underflow in logs padding calculation
This commit is contained in:
commit
ebbab14224
@ -204,8 +204,12 @@ func (f *taskFormatter) format(ctx context.Context, logCtx logContext) (string,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
padding := strings.Repeat(" ", f.padding-getMaxLength(task.Slot))
|
paddingCount := f.padding - getMaxLength(task.Slot)
|
||||||
formatted := fmt.Sprintf("%s@%s%s", taskName, nodeName, padding)
|
padding := ""
|
||||||
|
if paddingCount > 0 {
|
||||||
|
padding = strings.Repeat(" ", paddingCount)
|
||||||
|
}
|
||||||
|
formatted := taskName + "@" + nodeName + padding
|
||||||
f.cache[logCtx] = formatted
|
f.cache[logCtx] = formatted
|
||||||
return formatted, nil
|
return formatted, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user