1
1
Fork 0
mirror of https://tildegit.org/solderpunk/molly-brown synced 2024-04-28 06:45:03 +02:00

Restore logging functionality after some subtle variable declaration scoping bugs wiped it out!

This commit is contained in:
Solderpunk 2023-02-23 20:49:28 +01:00
parent a9dab7b48c
commit bff3d6d486

View File

@ -17,6 +17,7 @@ import (
var VERSION = "0.0.0"
func launch(config Config, privInfo userInfo) int {
var err error
// Open log files
if config.ErrorLog != "" {
@ -34,7 +35,7 @@ func launch(config Config, privInfo userInfo) int {
if config.AccessLog == "-" {
accessLogFile = os.Stdout
} else if config.AccessLog != "" {
accessLogFile, err := os.OpenFile(config.AccessLog, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
accessLogFile, err = os.OpenFile(config.AccessLog, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
log.Println("Error opening access log file: " + err.Error())
return 1
@ -130,7 +131,7 @@ func launch(config Config, privInfo userInfo) int {
if config.AccessLog == "" {
accessLogEntries = nil
} else {
accessLogEntries := make(chan LogEntry, 10)
accessLogEntries = make(chan LogEntry, 10)
go func() {
for {
entry := <-accessLogEntries