Skip to content

Commit

Permalink
updated body field in the Logs SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkuba committed Mar 22, 2024
1 parent 083c527 commit 7806029
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions experimental/packages/sdk-logs/src/LogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import type { IResource } from '@opentelemetry/resources';

import type { ReadableLogRecord } from './export/ReadableLogRecord';
import type { LogRecordLimits } from './types';
import { LogAttributes } from '@opentelemetry/api-logs';
import { LogAttributes, LogAttributeValue } from '@opentelemetry/api-logs';
import { LoggerProviderSharedState } from './internal/LoggerProviderSharedState';

export class LogRecord implements ReadableLogRecord {
Expand All @@ -38,7 +38,7 @@ export class LogRecord implements ReadableLogRecord {
readonly attributes: logsAPI.LogAttributes = {};
private _severityText?: string;
private _severityNumber?: logsAPI.SeverityNumber;
private _body?: string;
private _body?: LogAttributeValue;
private totalAttributesCount: number = 0;

private _isReadonly: boolean = false;
Expand All @@ -64,13 +64,13 @@ export class LogRecord implements ReadableLogRecord {
return this._severityNumber;
}

set body(body: string | undefined) {
set body(body: LogAttributeValue | undefined) {
if (this._isLogRecordReadonly()) {
return;
}
this._body = body;
}
get body(): string | undefined {
get body(): LogAttributeValue | undefined {
return this._body;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
import type { IResource } from '@opentelemetry/resources';
import type { HrTime, SpanContext } from '@opentelemetry/api';
import type { InstrumentationScope } from '@opentelemetry/core';
import type { LogAttributes, SeverityNumber } from '@opentelemetry/api-logs';
import type { LogAttributeValue, LogAttributes, SeverityNumber } from '@opentelemetry/api-logs';

export interface ReadableLogRecord {
readonly hrTime: HrTime;
readonly hrTimeObserved: HrTime;
readonly spanContext?: SpanContext;
readonly severityText?: string;
readonly severityNumber?: SeverityNumber;
readonly body?: string;
readonly body?: LogAttributeValue;
readonly resource: IResource;
readonly instrumentationScope: InstrumentationScope;
readonly attributes: LogAttributes;
Expand Down

0 comments on commit 7806029

Please sign in to comment.