@@ -119,18 +119,17 @@ The effect of calling this API is to emit a `LogRecord` to the processing pipeli
119
119
120
120
The API MUST accept the following parameters:
121
121
122
- - [ Timestamp] ( ./data-model.md#field-timestamp )
123
- - [ Observed Timestamp] ( ./data-model.md#field-observedtimestamp ) . If unspecified the
122
+ - [ Timestamp] ( ./data-model.md#field-timestamp ) (optional)
123
+ - [ Observed Timestamp] ( ./data-model.md#field-observedtimestamp ) (optional) . If unspecified the
124
124
implementation SHOULD set it equal to the current time.
125
- - The [ Context] ( ../context/README.md ) associated with the ` LogRecord ` . The API
126
- MAY implicitly use the current Context as a default
127
- behavior.
128
- - [ Severity Number] ( ./data-model.md#field-severitynumber )
129
- - [ Severity Text] ( ./data-model.md#field-severitytext )
130
- - [ Body] ( ./data-model.md#field-body )
131
- - [ Attributes] ( ./data-model.md#field-attributes )
132
-
133
- All parameters are optional.
125
+ - The [ Context] ( ../context/README.md ) associated with the ` LogRecord ` .
126
+ When implicit Context is supported, then this parameter SHOULD be optional and
127
+ if unspecified then MUST use current Context.
128
+ When only explicit Context is supported, this parameter SHOULD be required.
129
+ - [ Severity Number] ( ./data-model.md#field-severitynumber ) (optional)
130
+ - [ Severity Text] ( ./data-model.md#field-severitytext ) (optional)
131
+ - [ Body] ( ./data-model.md#field-body ) (optional)
132
+ - [ Attributes] ( ./data-model.md#field-attributes ) (optional)
134
133
135
134
#### Enabled
136
135
@@ -139,9 +138,22 @@ All parameters are optional.
139
138
To help users avoid performing computationally expensive operations when
140
139
generating a ` LogRecord ` , a ` Logger ` SHOULD provide this ` Enabled ` API.
141
140
142
- There are currently no required parameters for this API. Parameters can be
143
- added in the future, therefore, the API MUST be structured in a way for
144
- parameters to be added.
141
+ The API SHOULD accept the following parameters:
142
+
143
+ - The [ Context] ( ../context/README.md ) to be associated with the ` LogRecord ` .
144
+ When implicit Context is supported, then this parameter SHOULD be optional and
145
+ if unspecified then MUST use current Context.
146
+ When only explicit Context is supported, accepting this parameter is REQUIRED.
147
+ - [ Severity Number] ( ./data-model.md#field-severitynumber ) (optional)
148
+
149
+ Additional optional parameters can be added in the future, therefore,
150
+ the API MUST be structured in a way for these parameters to be added.
151
+
152
+ It SHOULD be possible to distinguish between an unspecified parameter value from
153
+ a parameter value set explicitly to a valid default value of given type
154
+ (e.g. distinguish unspecified attributes for empty attributes). The exception
155
+ from this rule is when the default value of given type is not seen as a valid
156
+ value like 0 for [ Severity Number] ( ./data-model.md#field-severitynumber ) .
145
157
146
158
This API MUST return a language idiomatic boolean type. A returned value of
147
159
` true ` means the ` Logger ` is enabled for the provided arguments, and a returned
0 commit comments