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

feat(core): allow setting logger context on EM level #5023

Merged
merged 2 commits into from Dec 15, 2023
Merged

Conversation

B4nan
Copy link
Member

@B4nan B4nan commented Dec 15, 2023

The logger context can now be also set on EntityManager level, e.g. via em.fork():

const fork = em.fork({
  loggerContext: { meaningOfLife: 42 },
});
const res = await fork.findAll(Author);

Closes #5022

The logger context can now be also set on `EntityManager` level, e.g. via `em.fork()`:

```ts
const fork = em.fork({
  loggerContext: { meaningOfLife: 42 },
});
const res = await fork.findAll(Author);
```

Closes #5022
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0cad3ed) 99.68% compared to head (5717758) 99.68%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5023   +/-   ##
=======================================
  Coverage   99.68%   99.68%           
=======================================
  Files         221      221           
  Lines       16236    16248   +12     
  Branches     3901     3902    +1     
=======================================
+ Hits        16185    16197   +12     
  Misses         51       51           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

The logger context can now be also set on `EntityManager` level, e.g. via `em.fork()`:

```ts
const fork = em.fork({
  loggerContext: { meaningOfLife: 42 },
});
const res = await fork.findAll(Author);
```

Closes #5022
@B4nan B4nan merged commit 7e56104 into master Dec 15, 2023
11 checks passed
@B4nan B4nan deleted the em-logger-context branch December 15, 2023 22:23
@mboudreau
Copy link

🤩

@mboudreau
Copy link

When's this expected to be release?

@B4nan
Copy link
Member Author

B4nan commented Dec 16, 2023

Its part of v6, every commit is published to npm as a dev version, so you can try this out already. Will ship new rc version during today and stable maybe within few days.

@mboudreau
Copy link

mboudreau commented Dec 16, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Forked Logger
2 participants