Add -logdir flag (#1039)

This allow configuring the various logs that may be outputted
(transcoder and future logs)
This commit is contained in:
tomleb
2021-05-22 19:29:49 -04:00
committed by GitHub
parent e311cb53ea
commit 1504ea3509
3 changed files with 16 additions and 3 deletions

View File

@ -37,6 +37,7 @@ func main() {
configFile := flag.String("configFile", "config.yaml", "Config file path to migrate to the new database")
dbFile := flag.String("database", "", "Path to the database file.")
logDirectory := flag.String("logdir", "", "Directory where logs will be written to")
enableDebugOptions := flag.Bool("enableDebugFeatures", false, "Enable additional debugging options.")
enableVerboseLogging := flag.Bool("enableVerboseLogging", false, "Enable additional logging.")
restoreDatabaseFile := flag.String("restoreDatabase", "", "Restore an Owncast database backup")
@ -58,6 +59,10 @@ func main() {
}
log.Infoln(config.GetReleaseString())
if *logDirectory != "" {
config.LogDirectory = *logDirectory
}
// Create the data directory if needed
if !utils.DoesFileExists("data") {
os.Mkdir("./data", 0700)