From 98a14b1bf8ab4b45f62eee98236a72109acbc316 Mon Sep 17 00:00:00 2001 From: grumbulon Date: Wed, 29 Jun 2022 22:57:03 +0000 Subject: [PATCH 1/2] Merge logawl package into master (#10) This PR is to bring in the new logging package for awl, I wanted to do some refinements before I opened this to upstream logawl works in the following ways 1. It prints logs directly to std.err 1. The default log level is Info (this can be changed multiple ways) 1. It supports four log levels Error, Fatal, Info, Debug 1. It differs from the syslog package in the stdlib wherin it default to std.err you do not _need_ to define an out file (syslog for example) 1. I added a "debug" flag so now we can go through and define verbose logging through the app 5.5 I made it so we can call `Logger.debug("message")` anywhere in the query file but unless the debug flag is set to true it will not print a message (it is working as intended finally). Co-authored-by: grumbulon Reviewed-on: https://git.froth.zone/sam/awl/pulls/10 Co-authored-by: grumbulon Co-committed-by: grumbulon --- cli.go | 5 ++ logawl/doc.go | 30 +++++++++++ logawl/logawl.go | 72 ++++++++++++++++++++++++++ logawl/logger.go | 130 +++++++++++++++++++++++++++++++++++++++++++++++ query.go | 12 +++-- 5 files changed, 246 insertions(+), 3 deletions(-) create mode 100644 logawl/doc.go create mode 100644 logawl/logawl.go create mode 100644 logawl/logger.go diff --git a/cli.go b/cli.go index f59b880..5fee552 100644 --- a/cli.go +++ b/cli.go @@ -133,6 +133,11 @@ func prepareCLI() *cli.App { Aliases: []string{"x"}, Usage: "do a reverse lookup", }, + &cli.BoolFlag{ + Name: "debug", + Usage: "enable debug logging", + Value: false, + }, }, Action: doQuery, } diff --git a/logawl/doc.go b/logawl/doc.go new file mode 100644 index 0000000..b67c5ea --- /dev/null +++ b/logawl/doc.go @@ -0,0 +1,30 @@ +/* +LogAwl is a package for custom logging needs + +LogAwl extends the standard log library with support for log levels +This is _different_ from the syslog package in the standard library because you do not define a file +because awl is a cli utility it writes directly to std err. +*/ +// Use the New() function to init logawl +// +// logger := logawl.New() +// +// You can call specific logging levels from your new logger using +// +// logger.Debug("Message to log") +// logger.Fatal("Message to log") +// logger.Info("Message to log") +// logger.Error("Message to log") +// +// You may also set the log level on the fly with +// +// Logger.SetLevel(3) +// This allows you to change the default level (Info) and prevent log messages from being posted at higher verbosity levels +//for example if +// Logger.SetLevel(3) +// is not called and you call +// Logger.Debug() +// this runs through +// IsLevel(level) +// to verify if the debug log should be sent to std.Err or not based on the current expected log level +package logawl diff --git a/logawl/logawl.go b/logawl/logawl.go new file mode 100644 index 0000000..e0beafd --- /dev/null +++ b/logawl/logawl.go @@ -0,0 +1,72 @@ +package logawl + +import ( + "fmt" + "io" + "sync" + "sync/atomic" +) + +type Level int32 +type Logger struct { + Mu sync.Mutex + Level Level + Prefix string + Out io.Writer + buf []byte + isDiscard int32 +} + +// Stores whatever input value is in mem address of l.level +func (l *Logger) SetLevel(level Level) { + atomic.StoreInt32((*int32)(&l.Level), int32(level)) +} + +// Mostly nothing +func (l *Logger) GetLevel() Level { + return l.level() +} + +// Retrieves whatever was stored in mem address of l.level +func (l *Logger) level() Level { + return Level(atomic.LoadInt32((*int32)(&l.Level))) +} + +// Unmarshalls the int value of level for writing the header +func (l *Logger) UnMarshalLevel(lv Level) (string, error) { + switch lv { + case 0: + return "FATAL ", nil + case 1: + return "ERROR ", nil + case 2: + return "INFO ", nil + case 3: + return "DEBUG ", nil + } + return "", fmt.Errorf("Invalid log level choice") +} + +func (l *Logger) IsLevel(level Level) bool { + return l.level() >= level +} + +var AllLevels = []Level{ + FatalLevel, + ErrorLevel, + InfoLevel, + DebugLevel, +} + +const ( + // Fatal logs (will call exit(1)) + FatalLevel Level = iota + + // Error logs + ErrorLevel + + // What is going on level + InfoLevel + // Verbose log level. + DebugLevel +) diff --git a/logawl/logger.go b/logawl/logger.go new file mode 100644 index 0000000..b101b7e --- /dev/null +++ b/logawl/logger.go @@ -0,0 +1,130 @@ +package logawl + +import ( + "fmt" + "os" + "sync/atomic" + "time" +) + +// Calling New instantiates Logger +// +// Level can be changed to one of the other log levels (FatalLevel, ErrorLevel, InfoLevel, DebugLevel) +func New() *Logger { + return &Logger{ + Out: os.Stderr, + Level: InfoLevel, //Default value is InfoLevel + } +} + +// Takes any and prints it out to Logger -> Out (io.Writer (default is std.Err)) +func (l *Logger) Println(level Level, v ...any) { + if atomic.LoadInt32(&l.isDiscard) != 0 { + return + } + //If verbose is not set --debug etc print _nothing_ + if l.IsLevel(level) { + switch level { //Goes through log levels and does stuff based on them (Fatal os.Exit...etc) + case 0: + l.Printer(0, fmt.Sprintln(v...)) //Fatal level + os.Exit(1) + case 1: + l.Printer(1, fmt.Sprintln(v...)) //Error level + os.Exit(2) + case 2: + l.Printer(2, fmt.Sprintln(v...)) //Info level + case 3: + l.Printer(3, fmt.Sprintln(v...)) //Debug level + default: + break + } + } +} + +// Formats the log header as such YYYY/MM/DD HH:MM:SS (local time) +func (l *Logger) formatHeader(buf *[]byte, t time.Time, line int, level Level) { + if lvl, err := l.UnMarshalLevel(level); err == nil { + // This is ugly but functional + // maybe there can be an append func or something in the future + *buf = append(*buf, lvl...) + year, month, day := t.Date() + *buf = append(*buf, '[') + formatter(buf, year, 4) + *buf = append(*buf, '/') + formatter(buf, int(month), 2) + *buf = append(*buf, '/') + formatter(buf, day, 2) + *buf = append(*buf, ' ') + hour, min, sec := t.Clock() + formatter(buf, hour, 2) + *buf = append(*buf, ':') + formatter(buf, min, 2) + *buf = append(*buf, ':') + formatter(buf, sec, 2) + *buf = append(*buf, ']') + *buf = append(*buf, ':') + *buf = append(*buf, ' ') + } else { + fmt.Printf("Unable to unmarshal log level: %v", err) + os.Exit(2) //Fucking kill him + } + +} + +// Printer prints the formatted message directly to stdErr +func (l *Logger) Printer(level Level, s string) error { + now := time.Now() + var line int + l.Mu.Lock() + defer l.Mu.Unlock() + + l.buf = l.buf[:0] + l.formatHeader(&l.buf, now, line, level) + l.buf = append(l.buf, s...) + if len(s) == 0 || s[len(s)-1] != '\n' { + l.buf = append(l.buf, '\n') + } + _, err := l.Out.Write(l.buf) + return err +} + +// Some line formatting stuff from Golang log stdlib file +// +// Please view https://cs.opensource.google/go/go/+/refs/tags/go1.18.3:src/log/log.go;drc=41e1d9075e428c2fc32d966b3752a3029b620e2c;l=96 +// +// Cheap integer to fixed-width decimal ASCII. Give a negative width to avoid zero-padding. +func formatter(buf *[]byte, i int, wid int) { + // Assemble decimal in reverse order. + var b [20]byte + bp := len(b) - 1 + for i >= 10 || wid > 1 { + wid-- + q := i / 10 + b[bp] = byte('0' + i - q*10) + bp-- + i = q + } + // i < 10 + b[bp] = byte('0' + i) + *buf = append(*buf, b[bp:]...) +} + +// Call print directly with Debug level +func (l *Logger) Debug(v ...any) { + l.Println(DebugLevel, v...) +} + +// Call print directly with Info level +func (l *Logger) Info(v ...any) { + l.Println(InfoLevel, v...) +} + +// Call print directly with Error level +func (l *Logger) Error(v ...any) { + l.Println(ErrorLevel, v...) +} + +// Call print directly with Fatal level +func (l *Logger) Fatal(v ...any) { + l.Println(FatalLevel, v...) +} diff --git a/query.go b/query.go index 57753b5..a84ff6c 100644 --- a/query.go +++ b/query.go @@ -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" @@ -19,15 +20,20 @@ func doQuery(c *cli.Context) error { err error resp util.Response isHTTPS bool + Logger = logawl.New() //init logger ) resp.Answers, err = parseArgs(c.Args().Slice()) if err != nil { + Logger.Error("Unable to parse args") return err } - port := c.Int("port") + if c.Bool("debug") { + Logger.SetLevel(3) + } + Logger.Debug("Starting awl") // If port is not set, set it if port == 0 { if c.Bool("tls") || c.Bool("quic") { @@ -67,8 +73,6 @@ func doQuery(c *cli.Context) error { msg.SetQuestion(resp.Answers.Name, resp.Answers.Request) - // TODO: maybe not make this a gross chunk of if statements? who knows - // Make this authoritative (does this do anything?) if c.Bool("aa") { msg.Authoritative = true @@ -79,6 +83,7 @@ func doQuery(c *cli.Context) error { } // Set the zero flag if requested (does nothing) if c.Bool("z") { + Logger.Debug("Setting message to zero") msg.Zero = true } // Disable DNSSEC validation @@ -95,6 +100,7 @@ func doQuery(c *cli.Context) error { } // Set DNSSEC if requested if c.Bool("dnssec") { + Logger.Debug("Using DNSSEC") msg.SetEdns0(1232, true) } From 5035898c1387404b47e5046012cf9405d653bf6c Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Wed, 29 Jun 2022 23:12:30 +0200 Subject: [PATCH 2/2] Add a LICENSE Signed-off-by: Sam Therapy --- LICENCE | 11 +++++++++++ awl.go | 2 ++ cli.go | 6 +----- cli_test.go | 1 + go.mod | 2 +- go.sum | 22 ++-------------------- logawl/{doc.go => docs.go} | 0 logawl/logawl.go | 2 ++ logawl/logger.go | 2 ++ query.go | 2 ++ query/HTTPS.go | 2 ++ query/QUIC.go | 2 ++ util/helpers.go | 2 ++ util/helpers_test.go | 2 ++ 14 files changed, 32 insertions(+), 26 deletions(-) create mode 100644 LICENCE rename logawl/{doc.go => docs.go} (100%) diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..3e87da9 --- /dev/null +++ b/LICENCE @@ -0,0 +1,11 @@ +Copyright 2022 Sam Therapy, Gregward Bulon + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/awl.go b/awl.go index 3f3242a..6c5af9c 100644 --- a/awl.go +++ b/awl.go @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause + package main import ( diff --git a/cli.go b/cli.go index 5fee552..6b18497 100644 --- a/cli.go +++ b/cli.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package main import ( @@ -133,11 +134,6 @@ func prepareCLI() *cli.App { Aliases: []string{"x"}, Usage: "do a reverse lookup", }, - &cli.BoolFlag{ - Name: "debug", - Usage: "enable debug logging", - Value: false, - }, }, Action: doQuery, } diff --git a/cli_test.go b/cli_test.go index cf826bb..dce74a8 100644 --- a/cli_test.go +++ b/cli_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package main import ( diff --git a/go.mod b/go.mod index c863eb8..94b74a2 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect - golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664 // indirect + golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/tools v0.1.11 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect diff --git a/go.sum b/go.sum index 0c05d7b..c9926fb 100644 --- a/go.sum +++ b/go.sum @@ -8,7 +8,6 @@ dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1 dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= @@ -120,7 +119,6 @@ github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -154,15 +152,9 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.4 h1:wZRexSlwd7ZXfKINDLsO4r7WBt3gTKONc6K/VesHvHM= -github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q= -github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= -github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= -github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/urfave/cli/v2 v2.10.3 h1:oi571Fxz5aHugfBAJd5nkwSk3fzATXtMlpxdLylSCMo= github.com/urfave/cli/v2 v2.10.3/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= @@ -171,7 +163,6 @@ github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRT github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= @@ -181,7 +172,6 @@ golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -206,14 +196,9 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220622184535-263ec571b305 h1:dAgbJ2SP4jD6XYfMNLVj0BF21jo2PjChrtGaAvF5M3I= -golang.org/x/net v0.0.0-20220622184535-263ec571b305/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -249,13 +234,10 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664 h1:wEZYwx+kK+KlZ0hpvP2Ls1Xr4+RWnlzGFwPP0aiDjIU= -golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b h1:2n253B2r0pYSmEV+UNCQoPfU/FiaizQEK5Gu4Bq4JE8= +golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= diff --git a/logawl/doc.go b/logawl/docs.go similarity index 100% rename from logawl/doc.go rename to logawl/docs.go diff --git a/logawl/logawl.go b/logawl/logawl.go index e0beafd..02bdce8 100644 --- a/logawl/logawl.go +++ b/logawl/logawl.go @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause + package logawl import ( diff --git a/logawl/logger.go b/logawl/logger.go index b101b7e..44ec205 100644 --- a/logawl/logger.go +++ b/logawl/logger.go @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause + package logawl import ( diff --git a/query.go b/query.go index a84ff6c..678c55d 100644 --- a/query.go +++ b/query.go @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause + package main import ( diff --git a/query/HTTPS.go b/query/HTTPS.go index 8389060..8eaec04 100644 --- a/query/HTTPS.go +++ b/query/HTTPS.go @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause + package query import ( diff --git a/query/QUIC.go b/query/QUIC.go index fda5465..43ca658 100644 --- a/query/QUIC.go +++ b/query/QUIC.go @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause + package query import ( diff --git a/util/helpers.go b/util/helpers.go index cb059b8..814bcb6 100644 --- a/util/helpers.go +++ b/util/helpers.go @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause + package util import ( diff --git a/util/helpers_test.go b/util/helpers_test.go index 0d0b6e5..c1aab94 100644 --- a/util/helpers_test.go +++ b/util/helpers_test.go @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause + package util import (