Skip to content

Commit 0fb2811

Browse files
committed
add debug logging
1 parent 3f281d9 commit 0fb2811

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

main.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ import (
1818
)
1919

2020
const (
21-
version = "0.1.4"
21+
version = "1.0.5"
2222
shutdownTimeout = 10 * time.Second
2323
)
2424

2525
func main() {
2626

27+
verbose := false
2728
app := cli.NewApp()
2829
app.Name = "docker-zfs-plugin"
2930
app.Usage = "Docker ZFS Plugin"
@@ -33,8 +34,19 @@ func main() {
3334
Name: "dataset-name",
3435
Usage: "Name of the ZFS dataset to be used. It will be created if it doesn't exist.",
3536
},
37+
cli.BoolFlag{
38+
Name: "verbose",
39+
Usage: "verbose output",
40+
Destination: &verbose,
41+
},
3642
}
3743
app.Action = Run
44+
app.Before = func(c *cli.Context) error {
45+
if verbose {
46+
log.SetLevel(log.DebugLevel)
47+
}
48+
return nil
49+
}
3850
err := app.Run(os.Args)
3951
if err != nil {
4052
panic(err)

zfs/driver.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ type ZfsDriver struct {
1717

1818
//NewZfsDriver returns the plugin driver object
1919
func NewZfsDriver(dss ...string) (*ZfsDriver, error) {
20-
log.SetLevel(log.DebugLevel)
2120
log.Debug("Creating new ZfsDriver.")
22-
2321
zd := &ZfsDriver{}
2422
if len(dss) < 1 {
2523
return nil, fmt.Errorf("No datasets specified")

0 commit comments

Comments
 (0)