From 3fa82ad29e1bba325b761128a07190319215b2fa Mon Sep 17 00:00:00 2001 From: John Shahid Date: Thu, 30 Oct 2014 13:42:45 -0400 Subject: [PATCH] Use FINE instead of TRACE when fine logging It turns out TRACE is a higher logging level than DEBUG which doesn't make much sense and is confusing. We can use FINE to achieve the same thing and it's descriptive and less confusing --- config.sample.toml | 2 +- daemon/influxd.go | 8 ++++++-- datastore/point_iterator.go | 10 +++++----- engine/aggregator_engine.go | 4 ++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/config.sample.toml b/config.sample.toml index e003225ea0..67c1d581b1 100644 --- a/config.sample.toml +++ b/config.sample.toml @@ -16,7 +16,7 @@ bind-address = "0.0.0.0" reporting-disabled = false [logging] -# logging level can be one of "debug", "info", "warn" or "error" +# logging level can be one of "fine", "debug", "info", "warn" or "error" level = "info" file = "influxdb.log" # stdout to log to standard out, or syslog facility diff --git a/daemon/influxd.go b/daemon/influxd.go index b089661b80..66446ae8c9 100644 --- a/daemon/influxd.go +++ b/daemon/influxd.go @@ -21,14 +21,18 @@ import ( func setupLogging(loggingLevel, logFile string) { level := log.DEBUG switch loggingLevel { - case "trace": - level = log.TRACE + case "fine": + level = log.FINE + case "debug": + level = log.DEBUG case "info": level = log.INFO case "warn": level = log.WARNING case "error": level = log.ERROR + default: + log.Error("Unknown log level %s. Defaulting to DEBUG", loggingLevel) } log.Global = make(map[string]*log.Filter) diff --git a/datastore/point_iterator.go b/datastore/point_iterator.go index 97af58f4da..0066469843 100644 --- a/datastore/point_iterator.go +++ b/datastore/point_iterator.go @@ -96,7 +96,7 @@ func (pi *PointIterator) Next() { // if the value is nil or doesn't match the point's timestamp and sequence number // then skip it if rcv.value == nil || rcv.time != next.time || rcv.sequence != next.sequence { - log4go.Trace("rcv = %#v, next = %#v", rcv, next) + log4go.Debug("rcv = %#v, next = %#v", rcv, next) pi.point.Values[i] = &protocol.FieldValue{IsNull: &TRUE} continue } @@ -164,7 +164,7 @@ func (pi *PointIterator) Close() { func (pi *PointIterator) getIteratorNextValue() error { for i, it := range pi.itrs { if pi.rawColumnValues[i].value != nil { - log4go.Trace("Value in iterator isn't nil, skipping") + log4go.Debug("Value in iterator isn't nil, skipping") continue } @@ -172,7 +172,7 @@ func (pi *PointIterator) getIteratorNextValue() error { if err := it.Error(); err != nil { return err } - log4go.Trace("Iterator isn't valid, skipping") + log4go.Debug("Iterator isn't valid, skipping") continue } @@ -184,13 +184,13 @@ func (pi *PointIterator) getIteratorNextValue() error { // if we ran out of points for this field go to the next iterator if sk.id != pi.fields[i].Id { - log4go.Trace("Different id reached") + log4go.Debug("Different id reached") continue } // if the point is outside the query start and end time if sk.time().Before(pi.startTime) || sk.time().After(pi.endTime) { - log4go.Trace("Outside time range: %s, %s", sk.time(), pi.startTime) + log4go.Debug("Outside time range: %s, %s", sk.time(), pi.startTime) continue } diff --git a/engine/aggregator_engine.go b/engine/aggregator_engine.go index eb69cf4378..54245c55b1 100644 --- a/engine/aggregator_engine.go +++ b/engine/aggregator_engine.go @@ -206,9 +206,9 @@ func (self *AggregatorEngine) aggregateValuesForSeries(series *protocol.Series) // update the state of the given group node := seriesState.trie.GetNode(group) var err error - log4go.Trace("Aggregating for group %v", group) + log4go.Debug("Aggregating for group %v", group) for idx, aggregator := range self.aggregators { - log4go.Trace("Aggregating value for %T for group %v and state %v", aggregator, group, node.states[idx]) + log4go.Debug("Aggregating value for %T for group %v and state %v", aggregator, group, node.states[idx]) node.states[idx], err = aggregator.AggregatePoint(node.states[idx], point) if err != nil { return false, err