Skip to content

Commit

Permalink
Use FINE instead of TRACE when fine logging
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jvshahid committed Oct 30, 2014
1 parent a428042 commit 3fa82ad
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config.sample.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 6 additions & 2 deletions daemon/influxd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions datastore/point_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -164,15 +164,15 @@ 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
}

if !it.Valid() {
if err := it.Error(); err != nil {
return err
}
log4go.Trace("Iterator isn't valid, skipping")
log4go.Debug("Iterator isn't valid, skipping")
continue
}

Expand All @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions engine/aggregator_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3fa82ad

Please sign in to comment.