logger: add DefaultCallerSkipCount

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-07-26 09:48:15 +03:00
parent 5c9b3dae33
commit af8d81f3c6
2 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,8 @@ var (
DefaultLogger Logger = NewLogger()
// DefaultLevel used by logger
DefaultLevel Level = InfoLevel
// DefaultCallerSkipCount used by logger
DefaultCallerSkipCount = 2
)
// Logger is a generic logging interface

View File

@ -33,7 +33,7 @@ func NewOptions(opts ...Option) Options {
Level: DefaultLevel,
Fields: make(map[string]interface{}),
Out: os.Stderr,
CallerSkipCount: 0,
CallerSkipCount: DefaultCallerSkipCount,
Context: context.Background(),
}
for _, o := range opts {