@@ -12,32 +12,13 @@ import (
12
12
"time"
13
13
)
14
14
15
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
16
+ // NOTE: The following are exported as public surface area from azcore. DO NOT MODIFY
17
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
18
+
15
19
// Event is used to group entries. Each group can be toggled on or off.
16
20
type Event string
17
21
18
- const (
19
- // EventRequest entries contain information about HTTP requests.
20
- // This includes information like the URL, query parameters, and headers.
21
- EventRequest Event = "Request"
22
-
23
- // EventResponse entries containe information about HTTP responses.
24
- // This includes information like the HTTP status code, headers, and request URL.
25
- EventResponse Event = "Response"
26
-
27
- // EventRetryPolicy entries contain information specific to the rety policy in use.
28
- EventRetryPolicy Event = "Retry"
29
-
30
- // EventLRO entries contian information specific to long-running operations.
31
- // This includes information like polling location, operation state, and sleep intervals.
32
- EventLRO Event = "LongRunningOperation"
33
- )
34
-
35
- // logger controls which events to log and writing to the underlying log.
36
- type logger struct {
37
- cls []Event
38
- lst func (Event , string )
39
- }
40
-
41
22
// SetEvents is used to control which events are written to
42
23
// the log. By default all log events are writen.
43
24
func SetEvents (cls ... Event ) {
@@ -49,6 +30,10 @@ func SetListener(lst func(Event, string)) {
49
30
log .lst = lst
50
31
}
51
32
33
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
34
+ // END PUBLIC SURFACE AREA
35
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
36
+
52
37
// Should returns true if the specified log event should be written to the log.
53
38
// By default all log events will be logged. Call SetEvents() to limit
54
39
// the log events for logging.
@@ -88,11 +73,17 @@ func Writef(cls Event, format string, a ...interface{}) {
88
73
log .lst (cls , fmt .Sprintf (format , a ... ))
89
74
}
90
75
91
- // TestResetEvents is used for testing purposes only .
76
+ // TestResetEvents is used for TESTING PURPOSES ONLY .
92
77
func TestResetEvents () {
93
78
log .cls = nil
94
79
}
95
80
81
+ // logger controls which events to log and writing to the underlying log.
82
+ type logger struct {
83
+ cls []Event
84
+ lst func (Event , string )
85
+ }
86
+
96
87
// the process-wide logger
97
88
var log logger
98
89
0 commit comments