mirror of
https://github.com/owncast/owncast.git
synced 2024-12-18 07:12:33 +03:00
Fix initial creation of logging directory
This commit is contained in:
parent
d042fd70d1
commit
5968aa49d2
2 changed files with 7 additions and 4 deletions
|
@ -6,6 +6,7 @@ package logging
|
||||||
import (
|
import (
|
||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -29,9 +30,10 @@ var Logger *OCLogger
|
||||||
// Setup configures our custom logging destinations.
|
// Setup configures our custom logging destinations.
|
||||||
func Setup(enableDebugOptions bool, enableVerboseLogging bool) {
|
func Setup(enableDebugOptions bool, enableVerboseLogging bool) {
|
||||||
// Create the logging directory if needed
|
// Create the logging directory if needed
|
||||||
if !utils.DoesFileExists(getLogFilePath()) {
|
loggingDirectory := filepath.Dir(getLogFilePath())
|
||||||
if err := os.Mkdir(getLogFilePath(), 0700); err != nil {
|
if !utils.DoesFileExists(loggingDirectory) {
|
||||||
logger.Errorln("unable to create directory", getLogFilePath(), err)
|
if err := os.Mkdir(loggingDirectory, 0700); err != nil {
|
||||||
|
logger.Errorln("unable to create logs directory", loggingDirectory, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
3
main.go
3
main.go
|
@ -38,7 +38,6 @@ func main() {
|
||||||
config.LogDirectory = *logDirectory
|
config.LogDirectory = *logDirectory
|
||||||
}
|
}
|
||||||
|
|
||||||
configureLogging(*enableDebugOptions, *enableVerboseLogging)
|
|
||||||
log.Infoln(config.GetReleaseString())
|
log.Infoln(config.GetReleaseString())
|
||||||
|
|
||||||
if *backupDirectory != "" {
|
if *backupDirectory != "" {
|
||||||
|
@ -52,6 +51,8 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configureLogging(*enableDebugOptions, *enableVerboseLogging)
|
||||||
|
|
||||||
// Allows a user to restore a specific database backup
|
// Allows a user to restore a specific database backup
|
||||||
if *restoreDatabaseFile != "" {
|
if *restoreDatabaseFile != "" {
|
||||||
databaseFile := config.DatabaseFilePath
|
databaseFile := config.DatabaseFilePath
|
||||||
|
|
Loading…
Reference in a new issue