Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify parameters for emtting a log record #3354

Merged
merged 17 commits into from
Apr 8, 2023
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions specification/logs/bridge-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
+ [Get a Logger](#get-a-logger)
- [Logger](#logger)
* [Logger operations](#logger-operations)
+ [Emit LogRecord](#emit-logrecord)
- [LogRecord](#logrecord)
* [Emit a LogRecord](#emit-a-logrecord)
- [Optional and required parameters](#optional-and-required-parameters)
- [Concurrency requirements](#concurrency-requirements)
- [Usage](#usage)
Expand Down Expand Up @@ -110,27 +110,25 @@ The `Logger` is responsible for emitting `LogRecord`s.

The `Logger` MUST provide functions to:

#### Emit LogRecord
- [Emit a `LogRecord`](#emit-a-logrecord) (see the section on `LogRecord`)

Emit a `LogRecord` to the processing pipeline.

This function MAY be named `logRecord`.

**Parameters:**
## LogRecord
alanwest marked this conversation as resolved.
Show resolved Hide resolved

* `logRecord` - the [LogRecord](#logrecord) to emit.
`LogRecord`s encapsulate the fields identified in the `LogRecord`
[data model](data-model.md).

## LogRecord
### Emit a LogRecord
jack-berg marked this conversation as resolved.
Show resolved Hide resolved

The API emits [LogRecords](#emit-logrecord) using the `LogRecord` [data model](data-model.md).
`LogRecord`s are emitted to the processing pipeline using an API provided by
[`Logger`](#logger).

A function receiving this as an argument MUST be able to set the following
parameters:
The API MUST accept the following parameters:
jack-berg marked this conversation as resolved.
Show resolved Hide resolved

- [Timestamp](./data-model.md#field-timestamp)
- [Observed Timestamp](./data-model.md#field-observedtimestamp)
- [Context](../context/README.md) that contains the
[TraceContext](./data-model.md#trace-context-fields)
- The [Context](../context/README.md) associated with the `LogRecord`. The API
MAY also have an option for implicitly using the current Context as a default
alanwest marked this conversation as resolved.
Show resolved Hide resolved
behavior.
- [Severity Number](./data-model.md#field-severitynumber)
- [Severity Text](./data-model.md#field-severitytext)
- [Body](./data-model.md#field-body)
Expand Down