change to use logging instead of print to stdout
This commit is contained in:
5
main.go
5
main.go
@@ -35,6 +35,7 @@ func main() {
|
||||
fmt.Println("Unable to write logfile", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
log.SetOutput(logfileWriter)
|
||||
|
||||
// Initiate connection to sqlite and make sure our schema is up to date
|
||||
models.ConnectDatabase()
|
||||
@@ -88,7 +89,7 @@ func main() {
|
||||
bindIP = "8443"
|
||||
}
|
||||
bindAddress := fmt.Sprint(bindIP, ":", bindPort)
|
||||
fmt.Printf("Will listen on address 'https://%s'\n", bindAddress)
|
||||
log.Printf("Will listen on address 'https://%s'\n", bindAddress)
|
||||
|
||||
// Get file names for TLS cert/key
|
||||
tlsCertFilename := os.Getenv("TLS_CERT_FILE")
|
||||
@@ -107,7 +108,7 @@ func main() {
|
||||
|
||||
// Generate certificate if required
|
||||
if !(utils.FileExists(tlsCertFilename) && utils.FileExists(tlsKeyFilename)) {
|
||||
fmt.Printf("Specified TLS certificate (%s) or private key (%s) do not exist.\n", tlsCertFilename, tlsKeyFilename)
|
||||
log.Printf("Specified TLS certificate (%s) or private key (%s) do not exist.\n", tlsCertFilename, tlsKeyFilename)
|
||||
utils.GenerateCerts(tlsCertFilename, tlsKeyFilename)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user