summaryrefslogtreecommitdiff
path: root/tests/gobang.go
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-09-07 09:38:02 -0300
committerEuAndreh <eu@euandre.org>2024-09-07 09:38:02 -0300
commitc833ae3d3f6db368d3e34491ec5adbb791a710f0 (patch)
tree9b6418be24abc6a91fddedd7c310c4a93ef12757 /tests/gobang.go
parentsrc/gobang.go: Add SetLevel() (diff)
downloadgobang-c833ae3d3f6db368d3e34491ec5adbb791a710f0.tar.gz
gobang-c833ae3d3f6db368d3e34491ec5adbb791a710f0.tar.xz
src/gobang.go: Export SetLoggerOutput()
Diffstat (limited to 'tests/gobang.go')
-rw-r--r--tests/gobang.go30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/gobang.go b/tests/gobang.go
index a1e3bb7..b26fc7e 100644
--- a/tests/gobang.go
+++ b/tests/gobang.go
@@ -575,7 +575,7 @@ func testLog(
savedLevel := level
s := new(strings.Builder)
- setLoggerOutput(s)
+ SetLoggerOutput(s)
level = filterLevel
fn("a-message", "a-type", "a-key", "a-value")
@@ -632,7 +632,7 @@ func testNoLog(filterLevel LogLevel, fn func(string, string, ...any)) {
savedLevel := level
s := new(strings.Builder)
- setLoggerOutput(s)
+ SetLoggerOutput(s)
level = filterLevel
fn("a-message", "a-type", "a-key", "a-value")
@@ -698,7 +698,7 @@ func test_metric() {
savedFlag := emitMetric
s := new(strings.Builder)
- setLoggerOutput(s)
+ SetLoggerOutput(s)
emitMetric = false
metric("", "")
@@ -713,7 +713,7 @@ func test_metric() {
savedFlag := emitMetric
s := new(strings.Builder)
- setLoggerOutput(s)
+ SetLoggerOutput(s)
emitMetric = true
metric("a-type", "a-label", "count-something", 123)
@@ -785,7 +785,7 @@ func test_MakeCounter() {
savedFlag := emitMetric
s := new(strings.Builder)
- setLoggerOutput(s)
+ SetLoggerOutput(s)
emitMetric = true
emitTCPError := MakeCounter("emit-tcp-error")
@@ -832,7 +832,7 @@ func test_MakeGauge() {
savedLevel := level
s := new(strings.Builder)
- setLoggerOutput(s)
+ SetLoggerOutput(s)
level = LevelError
activeTCPConnections := MakeGauge("active-tcp-connections")
@@ -883,7 +883,7 @@ func test_MakeGauge() {
savedFlag := emitMetric
s := new(strings.Builder)
- setLoggerOutput(s)
+ SetLoggerOutput(s)
emitMetric = true
activeTCPConnections := MakeGauge("active-tcp-connections")
@@ -970,14 +970,14 @@ func test_showColour() {
ErrorIf(os.Setenv(NAME, savedEnvvar))
}
-func test_setLoggerOutput() {
- TestStart("setLoggerOutput()")
+func test_SetLoggerOutput() {
+ TestStart("SetLoggerOutput()")
savedLogger := slog.Default()
Testing("the output JSON has data under \"src\"", func() {
s := new(strings.Builder)
- setLoggerOutput(s)
+ SetLoggerOutput(s)
Info("", "")
var data map[string]interface{}
@@ -1000,7 +1000,7 @@ func test_setLoggerOutput() {
AssertEqual(ok, true)
function, ok := functionRaw.(string)
AssertEqual(ok, true)
- AssertEqual(function, "gobang.test_setLoggerOutput.func1")
+ AssertEqual(function, "gobang.test_SetLoggerOutput.func1")
lineRaw, ok := src["line"]
AssertEqual(ok, true)
@@ -1010,7 +1010,7 @@ func test_setLoggerOutput() {
Testing("the output JSON has data under \"info\"", func() {
s := new(strings.Builder)
- setLoggerOutput(s)
+ SetLoggerOutput(s)
Info("", "")
var data map[string]interface{}
@@ -1044,7 +1044,7 @@ func test_setLoggerOutput() {
Testing("we can add groups to the default logger", func() {
s := new(strings.Builder)
- setLoggerOutput(s, slog.Group("one", "key", "value"))
+ SetLoggerOutput(s, slog.Group("one", "key", "value"))
Info("", "")
var data map[string]interface{}
@@ -1064,7 +1064,7 @@ func test_setLoggerOutput() {
Testing("the puuid is the same across calls to the logger", func() {
s := new(strings.Builder)
- setLoggerOutput(s)
+ SetLoggerOutput(s)
Info("", "first")
Info("", "second")
@@ -1290,7 +1290,7 @@ func t4() {
test_ErrorIf()
test_ErrorNil()
test_showColour()
- test_setLoggerOutput()
+ test_SetLoggerOutput()
test_levelFromString()
test_setLogLevel()
test_SetLevel()