Skip to content

Instantly share code, notes, and snippets.

@erayakartuna
Last active January 2, 2022 21:47
Show Gist options
  • Save erayakartuna/28e0822c0be700e52ecab19ead14c110 to your computer and use it in GitHub Desktop.
Save erayakartuna/28e0822c0be700e52ecab19ead14c110 to your computer and use it in GitHub Desktop.
logv7.go
func main() {
// init the log writer
log.InitRequestLogs()
// test logs
test()
}
func test() {
// Log with random data
go func() {
time.Sleep(time.Second * 1)
for i := 0; i <= 10; i++ {
log.Request(fmt.Sprintf("https://useinsider.com/test-%d", i), "req-body", 200, `{"success": true}`)
}
}()
// Log with random data
go func() {
time.Sleep(time.Second * 6)
for i := 0; i <= 10; i++ {
log.Request(fmt.Sprintf("https://useinsider.com/test-2-%d", i), "req-body", 200, `{"saved": true}`)
}
}()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment