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 8 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
27 changes: 10 additions & 17 deletions specification/logs/bridge-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
+ [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 +109,21 @@ The `Logger` is responsible for emitting `LogRecord`s.

The `Logger` MUST provide functions to:

#### Emit LogRecord
- Emit a `LogRecord`

Emit a `LogRecord` to the processing pipeline.
#### Emit a LogRecord

This function MAY be named `logRecord`.
`LogRecord`s encapsulate the fields identified in the `LogRecord`
[data model](data-model.md) and are emitted to the processing pipeline using
alanwest marked this conversation as resolved.
Show resolved Hide resolved
this API.

**Parameters:**

* `logRecord` - the [LogRecord](#logrecord) to emit.

## LogRecord

The API emits [LogRecords](#emit-logrecord) using the `LogRecord` [data model](data-model.md).

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