1
0
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:
2023-03-29 14:02:57 -07:00
parent e21fb8a614
commit 50c507c8f4
5 changed files with 289 additions and 4 deletions

View File

@@ -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))
}