*: reflow comments to 80 characters
This reformats the entire Metropolis codebase to have comments no longer
than 80 characters, implementing CR/66.
This has been done half manually, as we don't have a good integration
between commentwrap/Bazel, but that can be implemented if we decide to
go for this tool/limit.
Change-Id: If1fff0b093ef806f5dc00551c11506e8290379d0
diff --git a/metropolis/pkg/logtree/klog.go b/metropolis/pkg/logtree/klog.go
index 8755286..3dd040e 100644
--- a/metropolis/pkg/logtree/klog.go
+++ b/metropolis/pkg/logtree/klog.go
@@ -61,9 +61,8 @@
return k
}
-
type klogParser struct {
- n *node
+ n *node
buffer *logbuffer.LineBuffer
}
@@ -90,7 +89,7 @@
// we permit library users to 'fake' logs? This would also permit us to get rid
// of the type assertion in KLogParser().
e := &entry{
- origin: k.n.dn,
+ origin: k.n.dn,
leveled: p,
}
k.n.tree.journal.append(e)
@@ -98,14 +97,15 @@
}
var (
- // reKLog matches and parses klog/glog-formatted log lines.
- // Format: I0312 14:20:04.240540 204 shared_informer.go:247] Caches are synced for attach detach
+ // reKLog matches and parses klog/glog-formatted log lines. Format: I0312
+ // 14:20:04.240540 204 shared_informer.go:247] Caches are synced for attach
+ // detach
reKLog = regexp.MustCompile(`^([IEWF])(\d{4})\s+(\d{2}:\d{2}:\d{2}(\.\d+)?)\s+(\d+)\s+([^:]+):(\d+)]\s+(.+)$`)
)
// parse attempts to parse a klog-formatted line. Returns nil if the line
// couldn't have been parsed successfully.
-func parse(now time.Time, s string) (*LeveledPayload) {
+func parse(now time.Time, s string) *LeveledPayload {
parts := reKLog.FindStringSubmatch(s)
if parts == nil {
return nil
@@ -184,13 +184,14 @@
// The PID is discarded.
_ = pid
- // Finally we have extracted all the data from the line. Inject into the log publisher.
+ // Finally we have extracted all the data from the line. Inject into the log
+ // publisher.
return &LeveledPayload{
timestamp: ts,
- severity: severity,
- messages: []string{message},
- file: file,
- line: line,
+ severity: severity,
+ messages: []string{message},
+ file: file,
+ line: line,
}
}