Refactor log factory constructor

This commit is contained in:
世界
2023-04-03 18:24:20 +08:00
parent 0be3cdc8fb
commit 28aa4c4d1f
10 changed files with 164 additions and 74 deletions

View File

@@ -127,7 +127,10 @@ func create() (*box.Box, context.CancelFunc, error) {
options.Log.DisableColor = true
}
ctx, cancel := context.WithCancel(context.Background())
instance, err := box.New(ctx, options, nil)
instance, err := box.New(box.Options{
Context: ctx,
Options: options,
})
if err != nil {
cancel()
return nil, nil, E.Cause(err, "create service")