default_test.go — fiber Source File
Architecture documentation for default_test.go, a go file in the fiber codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR a9657611_ab19_70f1_938f_e28c9f9093e5["default_test.go"] c0b86961_3ef1_0168_52fc_98627566ed27["bytes"] a9657611_ab19_70f1_938f_e28c9f9093e5 --> c0b86961_3ef1_0168_52fc_98627566ed27 style a9657611_ab19_70f1_938f_e28c9f9093e5 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
package log
import (
"bytes"
"context"
"log"
"os"
"testing"
"github.com/stretchr/testify/require"
)
const work = "work"
func initDefaultLogger() {
logger = &defaultLogger{
stdlog: log.New(os.Stderr, "", 0),
depth: 4,
}
}
type byteSliceWriter struct {
b []byte
}
func (w *byteSliceWriter) Write(p []byte) (int, error) {
w.b = append(w.b, p...)
return len(p), nil
}
func Test_WithContextCaller(t *testing.T) {
logger = &defaultLogger{
stdlog: log.New(os.Stderr, "", log.Lshortfile),
depth: 4,
}
var w byteSliceWriter
SetOutput(&w)
ctx := context.TODO()
WithContext(ctx).Info("")
Info("")
require.Equal(t, "default_test.go:41: [Info] \ndefault_test.go:42: [Info] \n", string(w.b))
}
func Test_DefaultLogger(t *testing.T) {
initDefaultLogger()
var w byteSliceWriter
SetOutput(&w)
Trace("trace work")
Debug("received work order")
Info("starting work")
Warn("work may fail")
Error("work failed")
require.Panics(t, func() {
Panic("work panic")
// ... (424 more lines)
Domain
Subdomains
Functions
- Benchmark_LogfKeyAndValues()
- Benchmark_LogfKeyAndValues_Parallel()
- Test_CtxLogger()
- Test_Debugw()
- Test_DefaultFormatLogger()
- Test_DefaultLogger()
- Test_DefaultLoggerNonStringKeys()
- Test_Errorw()
- Test_Infow()
- Test_LogfKeyAndValues()
- Test_Logger()
- Test_Panicw()
- Test_SetLevel()
- Test_Tracew()
- Test_Warnw()
- Test_WithContextCaller()
- initDefaultLogger()
Classes
Dependencies
- bytes
Source
Frequently Asked Questions
What does default_test.go do?
default_test.go is a source file in the fiber codebase, written in go. It belongs to the FiberCore domain, Context subdomain.
What functions are defined in default_test.go?
default_test.go defines 17 function(s): Benchmark_LogfKeyAndValues, Benchmark_LogfKeyAndValues_Parallel, Test_CtxLogger, Test_Debugw, Test_DefaultFormatLogger, Test_DefaultLogger, Test_DefaultLoggerNonStringKeys, Test_Errorw, Test_Infow, Test_LogfKeyAndValues, and 7 more.
What does default_test.go depend on?
default_test.go imports 1 module(s): bytes.
Where is default_test.go in the architecture?
default_test.go is located at log/default_test.go (domain: FiberCore, subdomain: Context, directory: log).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free