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:
4
main.go
4
main.go
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user