Skip to content

Commit

Permalink
fix: tengo trace
Browse files Browse the repository at this point in the history
  • Loading branch information
Lack30 committed Mar 20, 2024
1 parent fca04ca commit 05ed518
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/tengo_trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ flag := import("flag")
- `debug(args ...Object)`: 输出 debug 级别日志。
- `info(args ...Object)`: 输出 info 级别日志。
- `warn(args ...Object)`: 输出 warn 级别日志。
- `error(args ...Object)`: 输出 error 级别日志。
- `errorf(args ...Object)`: 输出 error 级别日志。
- `set_level(level string) => error`: 设置日志级别,默认为 info。
- `fields(args ...trace.Field) => trace/error`: 添加 fields 输出,支持链式操作 trace.fields(fields).info()。
- `int(name string, value int) => trace.Field/error`: 返回 int 类型的 Field.
Expand Down
2 changes: 1 addition & 1 deletion tengo/builtin/trace/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func NewTrace() *ImportModule {
attrs["debug"] = &tengo.UserFunction{Name: "debug", Value: tm.Debug()}
attrs["info"] = &tengo.UserFunction{Name: "info", Value: tm.Info()}
attrs["warn"] = &tengo.UserFunction{Name: "warn", Value: tm.Warn()}
attrs["error"] = &tengo.UserFunction{Name: "error", Value: tm.Error()}
attrs["errorf"] = &tengo.UserFunction{Name: "errorf", Value: tm.Error()}
attrs["print"] = &tengo.UserFunction{Name: "print", Value: tm.Print()}
attrs["try"] = &tengo.UserFunction{Name: "try", Value: tm.Try()}
attrs["assert"] = &tengo.UserFunction{Name: "assert", Value: tm.Assert()}
Expand Down

0 comments on commit 05ed518

Please sign in to comment.