Last active
January 2, 2022 21:47
-
-
Save erayakartuna/28e0822c0be700e52ecab19ead14c110 to your computer and use it in GitHub Desktop.
logv7.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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