Skip to content

Commit

Permalink
Merge pull request #133 from appoptics/AO-14725-better-logs
Browse files Browse the repository at this point in the history
AO-14725: Logs improving
  • Loading branch information
jiwen624 authored Dec 4, 2019
2 parents d6a95ef + 076bc66 commit 33e4b5a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions v1/ao/internal/reporter/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (pe *PostEventsMethod) Call(ctx context.Context,
// It is mainly used for debug printing.
func (pe *PostEventsMethod) CallSummary() string {
rsp := resultRespStr(pe.Resp, pe.err)
return fmt.Sprintf("[%s] sent %d events, %d bytes, rtt=%v, rsp=%s.",
return fmt.Sprintf("[%s] sent %d events, %d bytes, rtt=%v, rsp=%s",
pe, pe.MessageLen(), pe.RequestSize(), pe.rtt, rsp)
}

Expand Down Expand Up @@ -208,7 +208,7 @@ func (pm *PostMetricsMethod) Call(ctx context.Context,
// mainly used for debug printing.
func (pm *PostMetricsMethod) CallSummary() string {
rsp := resultRespStr(pm.Resp, pm.err)
return fmt.Sprintf("[%s] sent %d metrics, %d bytes, rtt=%v, rsp=%s.",
return fmt.Sprintf("[%s] sent %d metrics, %d bytes, rtt=%v, rsp=%s",
pm, pm.MessageLen(), pm.RequestSize(), pm.rtt, rsp)
}

Expand Down Expand Up @@ -300,7 +300,7 @@ func (ps *PostStatusMethod) RetryOnErr(err error) bool {
// mainly used for debug printing.
func (ps *PostStatusMethod) CallSummary() string {
rsp := resultRespStr(ps.Resp, ps.err)
return fmt.Sprintf("[%s] sent status, rtt=%v, rsp=%s.", ps, ps.rtt, rsp)
return fmt.Sprintf("[%s] sent status, rtt=%v, rsp=%s", ps, ps.rtt, rsp)
}

// GetSettingsMethod is the struct for RPC method GetSettings
Expand Down Expand Up @@ -365,7 +365,7 @@ func (gs *GetSettingsMethod) Call(ctx context.Context,
// CallSummary returns a string representation of the RPC call result.
func (gs *GetSettingsMethod) CallSummary() string {
rsp := settingsRespStr(gs.Resp, gs.err)
return fmt.Sprintf("[%s] got settings, rtt=%v, rsp=%s.", gs, gs.rtt, rsp)
return fmt.Sprintf("[%s] got settings, rtt=%v, rsp=%s", gs, gs.rtt, rsp)
}

// RetryOnErr denotes if this method needs a retry on failure.
Expand Down Expand Up @@ -436,7 +436,7 @@ func (p *PingMethod) Call(ctx context.Context,
// mainly used for debug printing.
func (p *PingMethod) CallSummary() string {
rsp := resultRespStr(p.Resp, p.err)
return fmt.Sprintf("[%s] ping back, rtt=%v, rsp=%s.", p, p.rtt, rsp)
return fmt.Sprintf("[%s] ping back, rtt=%v, rsp=%s", p, p.rtt, rsp)
}

// RetryOnErr denotes if this RPC method needs a retry on failure.
Expand Down
6 changes: 3 additions & 3 deletions v1/ao/internal/reporter/reporter_grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ func newGRPCReporter() reporter {

r.start()

log.Warningf("AppOptics APM reporter v%s is initialized. id: %v Go version: %s.",
utils.Version(), r.done, utils.GoVersion())
log.Warningf("The reporter (%v, v%v, go%v) is initialized. Waiting for the dynamic settings.",
r.done, utils.Version(), utils.GoVersion())
return r
}

Expand Down Expand Up @@ -921,7 +921,7 @@ func (r *grpcReporter) updateSettings(settings *collector.SettingsResult) {
if !r.isReady() && hasDefaultSetting() {
r.cond.L.Lock()
r.setReady(true)
log.Warningf("AppOptics agent (%v) is ready.", r.done)
log.Warningf("Got dynamic settings. The AppOptics APM agent (%v) is ready.", r.done)
r.cond.Broadcast()
r.cond.L.Unlock()
}
Expand Down
2 changes: 1 addition & 1 deletion v1/ao/internal/utils/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

var (
// The AppOptics Go agent version
version = "1.11.0"
version = "1.12.0"

// The Go version
goVersion = strings.TrimPrefix(runtime.Version(), "go")
Expand Down

0 comments on commit 33e4b5a

Please sign in to comment.