util/router: move some messages to Trace level

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-07-15 22:53:30 +03:00
parent 96aa0b6906
commit b4e5d9462a
2 changed files with 7 additions and 7 deletions

View File

@ -102,7 +102,7 @@ type parser struct {
// topLevelSegments is the target of this parser.
func (p *parser) topLevelSegments() ([]segment, error) {
if logger.V(logger.TraceLevel) {
logger.Debug(context.TODO(), "Parsing %q", p.tokens)
logger.Trace(context.TODO(), "Parsing %q", p.tokens)
}
segs, err := p.segments()
if err != nil {

View File

@ -63,16 +63,16 @@ func NewPattern(version int, ops []int, pool []string, verb string, opts ...Patt
}
if version != 1 {
if logger.V(logger.DebugLevel) {
logger.Debug(context.TODO(), "unsupported version: %d", version)
if logger.V(logger.TraceLevel) {
logger.Trace(context.TODO(), "unsupported version: %d", version)
}
return Pattern{}, ErrInvalidPattern
}
l := len(ops)
if l%2 != 0 {
if logger.V(logger.DebugLevel) {
logger.Debug(context.TODO(), "odd number of ops codes: %d", l)
if logger.V(logger.TraceLevel) {
logger.Trace(context.TODO(), "odd number of ops codes: %d", l)
}
return Pattern{}, ErrInvalidPattern
}
@ -141,13 +141,13 @@ func NewPattern(version int, ops []int, pool []string, verb string, opts ...Patt
vars = append(vars, v)
stack--
if stack < 0 {
if logger.V(logger.DebugLevel) {
if logger.V(logger.TraceLevel) {
logger.Trace(context.TODO(), "stack underflow")
}
return Pattern{}, ErrInvalidPattern
}
default:
if logger.V(logger.DebugLevel) {
if logger.V(logger.TraceLevel) {
logger.Trace(context.TODO(), "invalid opcode: %d", op.code)
}
return Pattern{}, ErrInvalidPattern