Compare commits
17 commits
Author | SHA1 | Date | |
---|---|---|---|
a68821fc2a | |||
|
fb1c40d6d9 | ||
|
d845808a3c | ||
|
a62f0b0759 | ||
|
4353aa9559 | ||
|
f7e5a7adee | ||
be3b81029e | |||
dfea8060dd | |||
|
6d30a5ad9b | ||
|
a36f1b8685 | ||
d4b8d1469f | |||
f50b793931 | |||
|
68e6e54741 | ||
|
8b1a5f9147 | ||
|
6da6a55f6e | ||
8c61f9f409 | |||
|
182ec20469 |
2 changed files with 35 additions and 0 deletions
5
cli.go
5
cli.go
|
@ -134,6 +134,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,
|
||||
}
|
||||
|
|
30
logawl/doc.go
Normal file
30
logawl/doc.go
Normal file
|
@ -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
|
Loading…
Reference in a new issue