add lograw option
This commit is contained in:
+2
-1
@@ -28,6 +28,7 @@ var (
|
|||||||
device string
|
device string
|
||||||
baudrate int
|
baudrate int
|
||||||
bytesize byte
|
bytesize byte
|
||||||
|
lograw bool
|
||||||
|
|
||||||
dbFile string
|
dbFile string
|
||||||
dbInit bool
|
dbInit bool
|
||||||
@@ -86,13 +87,13 @@ func initConfig() {
|
|||||||
|
|
||||||
viper.AutomaticEnv() // read in environment variables that match
|
viper.AutomaticEnv() // read in environment variables that match
|
||||||
|
|
||||||
|
|
||||||
// If a config file is found, read it in.
|
// If a config file is found, read it in.
|
||||||
if err := viper.ReadInConfig(); err == nil {
|
if err := viper.ReadInConfig(); err == nil {
|
||||||
fmt.Println("Using config file:", viper.ConfigFileUsed())
|
fmt.Println("Using config file:", viper.ConfigFileUsed())
|
||||||
device = viper.GetString("serial.device")
|
device = viper.GetString("serial.device")
|
||||||
baudrate = viper.GetInt("serial.baudrate")
|
baudrate = viper.GetInt("serial.baudrate")
|
||||||
bytesize = byte(viper.GetInt("serial.bytesize"))
|
bytesize = byte(viper.GetInt("serial.bytesize"))
|
||||||
|
lograw = viper.GetBool("serial.lograw")
|
||||||
dbFile = viper.GetString("sqlite.file")
|
dbFile = viper.GetString("sqlite.file")
|
||||||
dbInit = viper.GetBool("sqlite.init")
|
dbInit = viper.GetBool("sqlite.init")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ serial:
|
|||||||
device: ttyS1
|
device: ttyS1
|
||||||
baudrate: 9600
|
baudrate: 9600
|
||||||
bytesize: 7
|
bytesize: 7
|
||||||
|
lograw: true
|
||||||
|
|
||||||
|
|
||||||
sqlite:
|
sqlite:
|
||||||
|
|||||||
Reference in New Issue
Block a user