Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "lora-mapper", Short: "Tool to create coverage maps for LoRa network", Long: `lora-mapper is a tool to create coverage maps for existing LoRa networks`, PersistentPreRun: func(cmd *cobra.Command, args []string) { var logLevel = log.InfoLevel var logHandlers []log.Handler if verbose { logHandlers = append(logHandlers, cliHandler.Default) } if debug { logLevel = log.DebugLevel } absLogFileLocation, err := filepath.Abs("lora-mapper.log") if err != nil { panic(err) } logFile, err = os.OpenFile(absLogFileLocation, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644) if err != nil { panic(err) } if err == nil { logHandlers = append(logHandlers, textHandler.New(logFile)) } log.SetHandler(multiHandler.New(logHandlers...)) log.SetLevel(logLevel) }, PersistentPostRun: func(cmd *cobra.Command, args []string) { if logFile != nil { logFile.Close() } }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.