Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: common/logging/cloudlog/logging.go

Issue 1622553005: Remove log filtering and add stringsetflag. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: error on empty Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « common/flag/stringsetflag/stringsetflag_test.go ('k') | common/logging/config.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package cloudlog 5 package cloudlog
6 6
7 import ( 7 import (
8 "crypto/rand" 8 "crypto/rand"
9 "encoding/hex" 9 "encoding/hex"
10 "fmt" 10 "fmt"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 func (l *boundCloudLogger) LogCall(level logging.Level, calldepth int, f string, args []interface{}) { 97 func (l *boundCloudLogger) LogCall(level logging.Level, calldepth int, f string, args []interface{}) {
98 if len(f) == 0 { 98 if len(f) == 0 {
99 return 99 return
100 } 100 }
101 101
102 text := fmt.Sprintf(f, args...) 102 text := fmt.Sprintf(f, args...)
103 fields := logging.GetFields(l.ctx) 103 fields := logging.GetFields(l.ctx)
104 if len(fields) > 0 { 104 if len(fields) > 0 {
105 » » text = text + " " + fields.FieldString(true) 105 » » text = text + " " + fields.String()
106 } 106 }
107 107
108 // Add logging fields to labels. 108 // Add logging fields to labels.
109 entry := cloudlogging.Entry{ 109 entry := cloudlogging.Entry{
110 Timestamp: clock.Now(l.ctx), 110 Timestamp: clock.Now(l.ctx),
111 Severity: l.getSeverity(level), 111 Severity: l.getSeverity(level),
112 Labels: make(map[string]string, len(fields)), 112 Labels: make(map[string]string, len(fields)),
113 TextPayload: text, 113 TextPayload: text,
114 } 114 }
115 115
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 153 }
154 154
155 // atomicCounter must be allocated separately. If embedding, use a pointer. 155 // atomicCounter must be allocated separately. If embedding, use a pointer.
156 // Stores current counter value. 156 // Stores current counter value.
157 type atomicCounter int64 157 type atomicCounter int64
158 158
159 func (c *atomicCounter) next() int64 { 159 func (c *atomicCounter) next() int64 {
160 nextPlusOne := atomic.AddInt64((*int64)(c), 1) 160 nextPlusOne := atomic.AddInt64((*int64)(c), 1)
161 return nextPlusOne - 1 161 return nextPlusOne - 1
162 } 162 }
OLDNEW
« no previous file with comments | « common/flag/stringsetflag/stringsetflag_test.go ('k') | common/logging/config.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698