fix(logfile): Add pkg to operate with logfiles
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/volker-raschek/flucky/pkg/cli"
|
||||
"github.com/volker-raschek/flucky/pkg/config"
|
||||
"github.com/volker-raschek/flucky/pkg/logfile"
|
||||
"github.com/volker-raschek/flucky/pkg/sensor"
|
||||
)
|
||||
|
||||
@ -36,6 +37,13 @@ var readTemperatureCmd = &cobra.Command{
|
||||
|
||||
// print temperatures on stdout
|
||||
cli.PrintTemperatures(temperatures, cnf, os.Stdout)
|
||||
|
||||
if logs {
|
||||
err := logfile.WriteTemperatures(cnf.Device.TemperatureLogfile, temperatures)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user