mirror of
https://tildegit.org/solderpunk/molly-brown
synced 2024-05-11 15:26:03 +02:00
Restore logging functionality after some subtle variable declaration scoping bugs wiped it out!
This commit is contained in:
parent
a9dab7b48c
commit
bff3d6d486
|
@ -17,6 +17,7 @@ import (
|
||||||
var VERSION = "0.0.0"
|
var VERSION = "0.0.0"
|
||||||
|
|
||||||
func launch(config Config, privInfo userInfo) int {
|
func launch(config Config, privInfo userInfo) int {
|
||||||
|
var err error
|
||||||
|
|
||||||
// Open log files
|
// Open log files
|
||||||
if config.ErrorLog != "" {
|
if config.ErrorLog != "" {
|
||||||
|
@ -34,7 +35,7 @@ func launch(config Config, privInfo userInfo) int {
|
||||||
if config.AccessLog == "-" {
|
if config.AccessLog == "-" {
|
||||||
accessLogFile = os.Stdout
|
accessLogFile = os.Stdout
|
||||||
} else if config.AccessLog != "" {
|
} 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 {
|
if err != nil {
|
||||||
log.Println("Error opening access log file: " + err.Error())
|
log.Println("Error opening access log file: " + err.Error())
|
||||||
return 1
|
return 1
|
||||||
|
@ -130,7 +131,7 @@ func launch(config Config, privInfo userInfo) int {
|
||||||
if config.AccessLog == "" {
|
if config.AccessLog == "" {
|
||||||
accessLogEntries = nil
|
accessLogEntries = nil
|
||||||
} else {
|
} else {
|
||||||
accessLogEntries := make(chan LogEntry, 10)
|
accessLogEntries = make(chan LogEntry, 10)
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
entry := <-accessLogEntries
|
entry := <-accessLogEntries
|
||||||
|
|
Loading…
Reference in New Issue