Merge logawl package into master #10

Merged
sam merged 13 commits from grumbulon/awl:master into master 2022-06-29 22:57:04 +00:00
2 changed files with 10 additions and 0 deletions
Showing only changes of commit a36f1b8685 - Show all commits

4
cli.go
View file

@ -133,6 +133,10 @@ func prepareCLI() *cli.App {
Aliases: []string{"x"},
Usage: "do a reverse lookup",
},
&cli.BoolFlag{
Name: "debug",
Usage: "enable debug logging",
},
},
Action: doQuery,
}

View file

@ -8,6 +8,7 @@ import (
"strings"
"time"
"git.froth.zone/sam/awl/logawl"
"git.froth.zone/sam/awl/query"
"git.froth.zone/sam/awl/util"
"github.com/miekg/dns"
@ -26,6 +27,11 @@ func doQuery(c *cli.Context) error {
return err
}
logger := logawl.New() //init logger
if c.Bool("debug") {
logger.SetLevel(3) //set level to debug
}
port := c.Int("port")
// If port is not set, set it