use io.Writer

This commit is contained in:
Jeff Carr 2024-11-14 04:58:57 -06:00
parent 72d75ee478
commit 56145cd22a
2 changed files with 5 additions and 5 deletions

View File

@ -27,7 +27,6 @@ package log
import ( import (
"net/http" "net/http"
"os"
"sync" "sync"
) )
@ -57,7 +56,6 @@ type LogFlag struct {
var flags []*LogFlag var flags []*LogFlag
var daemonMode bool var daemonMode bool
var captureMode *os.File
var httpMode http.ResponseWriter var httpMode http.ResponseWriter
func init() { func init() {

View File

@ -5,17 +5,19 @@ package log
import ( import (
"fmt" "fmt"
"io"
reallog "log" reallog "log"
"net/http" "net/http"
"os"
) )
func DaemonMode(b bool) { func DaemonMode(b bool) {
daemonMode = b daemonMode = b
} }
func CaptureMode(f *os.File) { var captureMode io.Writer
captureMode = f
func CaptureMode(w io.Writer) {
captureMode = w
} }
func HttpMode(w http.ResponseWriter) { func HttpMode(w http.ResponseWriter) {