mirror of
https://github.com/taigrr/log-socket
synced 2026-03-21 00:12:19 -07:00
add ability to embed other loggers of varying functionality
This commit is contained in:
5
main.go
5
main.go
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"log"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
@@ -29,5 +30,9 @@ func main() {
|
||||
http.HandleFunc("/ws", ws.LogSocketHandler)
|
||||
http.HandleFunc("/", browser.LogSocketViewHandler)
|
||||
go generateLogs()
|
||||
dLogger := log.Default()
|
||||
lsLogger := logger.Default()
|
||||
lsLogger.SubLoggers = append(lsLogger.SubLoggers, logger.EnrichLogger(dLogger))
|
||||
lsLogger.Println("This should be printed out twice!")
|
||||
logger.Fatal(http.ListenAndServe(*addr, nil))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user