@@ -2,6 +2,7 @@ package utils
22
33import (
44 stdCtx "context"
5+ "fmt"
56 "os"
67 "path/filepath"
78 "runtime"
@@ -49,12 +50,13 @@ func NewContext(ctx stdCtx.Context, t ginkgo.FullGinkgoTInterface) *Context {
4950 tuikitIO .WithOutput (stdOut ),
5051 tuikitIO .WithTheme (io .Theme ("" )),
5152 tuikitIO .WithMode (tuikitIO .Text ),
52- tuikitIO .WithExitFunc (func () {
53+ tuikitIO .WithExitFunc (func (msg string , args ... any ) {
54+ msg = fmt .Sprintf (msg , args ... )
5355 _ , file , line , ok := runtime .Caller (3 )
5456 if ok {
55- t .Fatalf ("logger exit called from %s:%d" , file , line )
57+ t .Fatalf ("logger exit called from %s:%d - %s " , file , line , msg )
5658 } else {
57- t .Fatalf ("logger exit called" )
59+ t .Fatalf ("logger exit called - %s" , msg )
5860 }
5961 }),
6062 )
@@ -123,12 +125,13 @@ func ResetTestContext(ctx *Context, t ginkgo.FullGinkgoTInterface) {
123125 tuikitIO .WithOutput (stdOut ),
124126 tuikitIO .WithTheme (io .Theme ("" )),
125127 tuikitIO .WithMode (tuikitIO .Text ),
126- tuikitIO .WithExitFunc (func () {
128+ tuikitIO .WithExitFunc (func (msg string , args ... any ) {
129+ msg = fmt .Sprintf (msg , args ... )
127130 _ , file , line , ok := runtime .Caller (3 )
128131 if ok {
129- t .Fatalf ("logger exit called from %s:%d" , file , line )
132+ t .Fatalf ("logger exit called from %s:%d - %s " , file , line , msg )
130133 } else {
131- t .Fatalf ("logger exit called" )
134+ t .Fatalf ("logger exit called - %s" , msg )
132135 }
133136 }),
134137 )
0 commit comments