-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Add LoggerProvider
support to @effect/opentelemetry
#4371
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 67ebeef The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Working on tests and docs before removing draft status |
LoggerProvider
support to @effect/opentelemetry
I tried to follow the existing structure as best I could, but please let me know if anything needs to be modified. |
) | ||
|
||
/** @internal */ | ||
const formatMessage = Match.type<unknown>().pipe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead we can reuse this
Using the Match module is a bit too much here.
There are probably other functions that could be moved to a utils module
severityText: structured.logLevel, | ||
severityNumber: options.logLevel.ordinal, | ||
timestamp: options.date, | ||
observedTimestamp: new Date(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use the clock service instead.
* @since 1.0.0 | ||
* @category layers | ||
*/ | ||
export const layerLoggerProvider = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a direct export instead of a wrapper function
Type
Description
Add
LoggerProvider
andLogRecordProcessor
support to@effect/opentelemetry
, as well as a logger layer (usingLogger.addEffect
to run alongside existing loggers) that will emit logs using the registeredLogRecordProcessor
.