mylog

package module
v0.0.0-...-732fb26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 17 Imported by: 29

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Body

func Body() string

Body log包不能依赖任何包,目前的引用逻辑是这样的: stream -->safeType-->log safeType包单独提出来以便后续的更多封装调用它,比如文本编辑器等所有输入类型的控件 widget -->safeType-->log 文本编辑器设置数据借safeType支持了更多类似的设置支持 safeType -->log

func DumpRequest

func DumpRequest(req *http.Request, body bool) string

func DumpResponse

func DumpResponse(resp *http.Response, body bool) string

func Error

func Error(err any) bool

func Assert(t *testing.T) *assert.Assertions { return assert.New(t) }

func Error2

func Error2(_ any, err error) bool

func Hex

func Hex[T constraints.Integer | []byte | *bytes.Buffer](title string, msg T) string

func HexDump

func HexDump(title string, b []byte)

func HexInteger

func HexInteger[T constraints.Integer](msg T) string

func Info

func Info(title string, msg ...any)

func IsAndroid

func IsAndroid() bool

func IsLinux

func IsLinux() bool

func IsWindows

func IsWindows() bool

func Json

func Json(title string, msg ...any)

func MarshalJson

func MarshalJson(title string, msg any)

func Message

func Message() string

func Reason

func Reason() (reason string)

func Request

func Request(Request *http.Request, body bool)

func Response

func Response(Response *http.Response, body bool)

func SetDebug

func SetDebug(debug bool)

func Struct

func Struct(msg any)

func Success

func Success(title string, msg ...any)

func Trace

func Trace(title string, msg ...any)

func True

func True(b bool)

True 又要安全的接口断言,又不能影响可读性,只能检测ok强制不返回了,但是可以捕捉到错误

func TruncateLogFile

func TruncateLogFile()

func Warning

func Warning(title string, msg ...any)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL