1
0
mirror of https://github.com/taigrr/log-socket synced 2026-03-21 00:12:19 -07:00

Adds autoscroll feature to browser

This commit is contained in:
2021-04-09 10:39:23 -07:00
parent b744f083dc
commit 2c7cf0494e
2 changed files with 16 additions and 3 deletions

View File

@@ -19,14 +19,14 @@ func generateLogs() {
logger.Debug("This is a debug log!")
logger.Warn("This is a warn log!")
logger.Error("This is an error log!")
time.Sleep(10 * time.Second)
time.Sleep(2 * time.Second)
}
}
func main() {
defer logger.Flush()
flag.Parse()
http.HandleFunc("/logs", ws.LogSocketHandler)
http.HandleFunc("/ws", ws.LogSocketHandler)
http.HandleFunc("/", browser.LogSocketViewHandler)
go generateLogs()
logger.Fatal(http.ListenAndServe(*addr, nil))