Added LogPath and ConfigFile command line flags.

This commit is contained in:
scruzin 2019-01-05 08:48:47 +10:30
parent c971d4b225
commit 04a76e424a
1 changed files with 7 additions and 1 deletions

View File

@ -119,11 +119,13 @@ func handleFlags() revid.Config {
verticalFlipPtr = flag.Bool("VerticalFlip", false, "Flip video vertically: Yes, No") verticalFlipPtr = flag.Bool("VerticalFlip", false, "Flip video vertically: Yes, No")
horizontalFlipPtr = flag.Bool("HorizontalFlip", false, "Flip video horizontally: Yes, No") horizontalFlipPtr = flag.Bool("HorizontalFlip", false, "Flip video horizontally: Yes, No")
rtpAddrPtr = flag.String("RtpAddr", "", "Rtp destination address: <IP>:<port> (port is generally 6970-6999)") rtpAddrPtr = flag.String("RtpAddr", "", "Rtp destination address: <IP>:<port> (port is generally 6970-6999)")
logPathPtr = flag.String("LogPath", defaultLogPath, "The log path")
configFilePtr = flag.String("ConfigFile", "", "NetSender config file")
) )
flag.Parse() flag.Parse()
log = logger.New(defaultLogVerbosity, &smartlogger.New("/var/log/netsender").LogRoller) log = logger.New(defaultLogVerbosity, &smartlogger.New(*logPathPtr).LogRoller)
cfg.Logger = log cfg.Logger = log
@ -229,6 +231,10 @@ func handleFlags() revid.Config {
log.Log(logger.Error, pkg+"bad verbosity argument") log.Log(logger.Error, pkg+"bad verbosity argument")
} }
if *configFilePtr != "" {
netsender.ConfigFile = *configFilePtr
}
cfg.Quantize = *quantizePtr cfg.Quantize = *quantizePtr
cfg.FlipHorizontal = *horizontalFlipPtr cfg.FlipHorizontal = *horizontalFlipPtr
cfg.FlipVertical = *verticalFlipPtr cfg.FlipVertical = *verticalFlipPtr