Skip to content

Add setOnFlushError method to BraintrustState and HTTPBackgroundLogger#1515

Open
colinbennettbrain wants to merge 3 commits intomainfrom
onFlushError-logger
Open

Add setOnFlushError method to BraintrustState and HTTPBackgroundLogger#1515
colinbennettbrain wants to merge 3 commits intomainfrom
onFlushError-logger

Conversation

@colinbennettbrain
Copy link
Contributor

  • Added setOnFlushError method to BraintrustState and HTTPBackgroundLogger to manage error callbacks during log flushing.
  • Updated login, initLogger, and initExperiment functions to accept and set the onFlushError callback.
  • Enhanced tests in logger-misc.test.ts to verify the correct wiring of the onFlushError callback during logger initialization and login processes.

…rwritten by SDK defaults in the TypeScript SDK's ObjectFetcher.fetchRecordsFromApi().
- Added `setOnFlushError` method to `BraintrustState` and `HTTPBackgroundLogger` to manage error callbacks during log flushing.
- Updated `login`, `initLogger`, and `initExperiment` functions to accept and set the `onFlushError` callback.
- Enhanced tests in `logger-misc.test.ts` to verify the correct wiring of the `onFlushError` callback during logger initialization and login processes.
@lforst
Copy link
Member

Would you mind sharing the use-case behind this change? IMO the onFlushError on initLogger is already more than powerful enough to cover any use-case I could think of.

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.

2 participants