Home / Function/ Test_CtxLogger() — fiber Function Reference

Test_CtxLogger() — fiber Function Reference

Architecture documentation for the Test_CtxLogger() function in default_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  dd236fe1_2981_84c3_ba83_ba28192ebbc6["Test_CtxLogger()"]
  a9657611_ab19_70f1_938f_e28c9f9093e5["default_test.go"]
  dd236fe1_2981_84c3_ba83_ba28192ebbc6 -->|defined in| a9657611_ab19_70f1_938f_e28c9f9093e5
  c0a2310f_9b11_adeb_4509_b1cbac2f3429["initDefaultLogger()"]
  dd236fe1_2981_84c3_ba83_ba28192ebbc6 -->|calls| c0a2310f_9b11_adeb_4509_b1cbac2f3429
  style dd236fe1_2981_84c3_ba83_ba28192ebbc6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

log/default_test.go lines 95–119

func Test_CtxLogger(t *testing.T) {
	initDefaultLogger()

	var w byteSliceWriter
	SetOutput(&w)

	ctx := context.Background()

	WithContext(ctx).Tracef("trace %s", work)
	WithContext(ctx).Debugf("received %s order", work)
	WithContext(ctx).Infof("starting %s", work)
	WithContext(ctx).Warnf("%s may fail", work)
	WithContext(ctx).Errorf("%s failed %d", work, 50)

	require.Panics(t, func() {
		WithContext(ctx).Panicf("%s panic", work)
	})

	require.Equal(t, "[Trace] trace work\n"+
		"[Debug] received work order\n"+
		"[Info] starting work\n"+
		"[Warn] work may fail\n"+
		"[Error] work failed 50\n"+
		"[Panic] work panic\n", string(w.b))
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_CtxLogger() do?
Test_CtxLogger() is a function in the fiber codebase, defined in log/default_test.go.
Where is Test_CtxLogger() defined?
Test_CtxLogger() is defined in log/default_test.go at line 95.
What does Test_CtxLogger() call?
Test_CtxLogger() calls 1 function(s): initDefaultLogger.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free