forked from inaneverb/ekacore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentry.go
More file actions
71 lines (56 loc) · 2.17 KB
/
Copy pathentry.go
File metadata and controls
71 lines (56 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright © 2020. All rights reserved.
// Author: Ilya Stroy.
// Contacts: qioalice@gmail.com, https://github.com/qioalice
// License: https://opensource.org/licenses/MIT
package ekalog
import (
"time"
"github.com/qioalice/ekago/v2/internal/ekaletter"
)
//
// It's possible when
// case 14. log finisher called with Error and field(s) at the same time. We won't add
// passed log fields to the error's ones 'cause we want to keep attached error
// unmodified (and do not want to make copy because of optimization purposes).
// CASE 15:
// "Possibly incomplete stacktrace when error is attached".
// Stacktrace could be generated by the logger if an attached error doesn't have one.
//
// In this case еhe stacktrace can be "incomplete" because the attached error
// can be generated in the internal function and returned to the outside,
// where the log entry is generated.
type (
// TODO
Entry struct {
// TODO
l *Logger // The logger this entry created by or belongs to. Private.
// TODO
// Public because of providing access from the user's Integrator.
LogLetter *ekaletter.Letter
// TODO
// Public because of providing access from the user's Integrator.
ErrLetter *ekaletter.Letter
// Level indicates how important occurred event (this log entry represents) is.
// Assigned in log finisher.
Level Level
// Time contains the time when an event occurred this log entry represents.
// Generated automatically by time.Now() call in log finisher.
Time time.Time
needSetFinalizer bool
//ssf int // skip stack frames
//ssfp int // skip stack frames private ("3" by default)
//
//// Because stacktrace could be not empty in both cases of
//// "attach caller info to log entry", "attack stacktrace to log entry",
//// we need to determine which one case we have (or both of them).
//
//NeedCaller bool // true if "attach caller info to log entry"
//NeedStackTrace bool // true if "attach stacktrace to log entry"
}
)
var (
// DefaultFlags is the Flag's set that will be used as default flags
// for each *LetterItem that is created for Entry's *Letter.
DefaultFlags = FLAG_ALLOW_UNNAMED_NIL
// TODO: Maybe these flags must be protected by the mutex?
)