feat(pkg/logfile): add compression
This commit is contained in:
@ -12,6 +12,7 @@ import (
|
||||
"github.com/volker-raschek/flucky/pkg/sensor"
|
||||
)
|
||||
|
||||
var compression bool
|
||||
var logs bool
|
||||
|
||||
var readTemperatureCmd = &cobra.Command{
|
||||
@ -39,7 +40,7 @@ var readTemperatureCmd = &cobra.Command{
|
||||
cli.PrintTemperatures(temperatures, cnf, os.Stdout)
|
||||
|
||||
if logs {
|
||||
err := logfile.WriteTemperatures(cnf.Device.TemperatureLogfile, temperatures)
|
||||
err := logfile.WriteTemperatures(temperatures, cnf.Device.TemperatureLogfile, compression)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
@ -49,6 +50,6 @@ var readTemperatureCmd = &cobra.Command{
|
||||
|
||||
func init() {
|
||||
temperatureCmd.AddCommand(readTemperatureCmd)
|
||||
// readTemperatureCmd.Flags().BoolVarP(&follow, "follow", "f", false, "Follow output")
|
||||
readTemperatureCmd.Flags().BoolVarP(&logs, "logs", "l", true, "Log temperature")
|
||||
readTemperatureCmd.Flags().BoolVarP(&compression, "compression", "c", true, "Compress measured with logged temperatures")
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ var temperatureCmd = &cobra.Command{
|
||||
// Execute a
|
||||
func InitCmd(cmd *cobra.Command, configPath string) {
|
||||
cnfPath = configPath
|
||||
|
||||
cmd.AddCommand(temperatureCmd)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user