-
Notifications
You must be signed in to change notification settings - Fork 0
Fix browser logging issues #257
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@eppo/js-client-sdk](./js-client-sdk.md) > [LogLevel](./js-client-sdk.loglevel.md) | ||
|
||
## LogLevel type | ||
|
||
Valid log levels for the Eppo SDK logger. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent'; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@eppo/js-client-sdk](./js-client-sdk.md) > [setLogLevel](./js-client-sdk.setloglevel.md) | ||
|
||
## setLogLevel() function | ||
|
||
Sets the log level for the Eppo SDK logger globally. This affects all logging across the entire SDK, including both EppoJSClient and EppoPrecomputedJSClient instances. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare function setLogLevel(level: LogLevel): void; | ||
``` | ||
|
||
## Parameters | ||
|
||
<table><thead><tr><th> | ||
|
||
Parameter | ||
|
||
|
||
</th><th> | ||
|
||
Type | ||
|
||
|
||
</th><th> | ||
|
||
Description | ||
|
||
|
||
</th></tr></thead> | ||
<tbody><tr><td> | ||
|
||
level | ||
|
||
|
||
</td><td> | ||
|
||
[LogLevel](./js-client-sdk.loglevel.md) | ||
|
||
|
||
</td><td> | ||
|
||
The log level to set: - 'trace': Most verbose, logs everything - 'debug': Detailed debugging information - 'info': General informational messages - 'warn': Warning messages (default in production) - 'error': Error messages only - 'silent': Disable all logging | ||
|
||
|
||
</td></tr> | ||
</tbody></table> | ||
|
||
**Returns:** | ||
|
||
void | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,6 +216,9 @@ export interface IPrecomputedClientConfigSync { | |
throwOnFailedInitialization?: boolean; | ||
} | ||
|
||
// @public | ||
export type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're not supporting |
||
|
||
// Warning: (ae-internal-missing-underscore) The name "NO_OP_EVENT_DISPATCHER" should be prefixed with an underscore because the declaration is marked as @internal | ||
// | ||
// @internal (undocumented) | ||
|
@@ -232,6 +235,9 @@ export function offlinePrecomputedInit(config: IPrecomputedClientConfigSync): Ep | |
// @public | ||
export function precomputedInit(config: IPrecomputedClientConfig): Promise<EppoPrecomputedClient>; | ||
|
||
// @public | ||
export function setLogLevel(level: LogLevel): void; | ||
|
||
// (No @packageDocumentation comment for this package) | ||
|
||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@eppo/js-client-sdk", | ||
"version": "3.17.0", | ||
"version": "3.18.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bumping minor version because of new public method and type |
||
"description": "Eppo SDK for client-side JavaScript applications", | ||
"main": "dist/index.js", | ||
"files": [ | ||
|
@@ -59,7 +59,7 @@ | |
"webpack-cli": "^6.0.1" | ||
}, | ||
"dependencies": { | ||
"@eppo/js-client-sdk-common": "4.15.1", | ||
"@eppo/js-client-sdk-common": "/tmp/packages/js-sdk-common", | ||
|
||
"@types/chrome": "^0.0.313", | ||
"lz-string": "^1.5.0" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1679,9 +1679,15 @@ describe('EppoClient config', () => { | |
}); | ||
|
||
expect(client).toBe(EppoPrecomputedJSClient.instance); | ||
td.verify(applicationLogger.error('[Eppo SDK] Invalid precomputed configuration wire'), { | ||
times: 1, | ||
}); | ||
td.verify( | ||
applicationLogger.error( | ||
td.matchers.contains({ err: td.matchers.anything() }), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pino API (link) is to have the context object first. |
||
'[Eppo SDK] Invalid precomputed configuration wire', | ||
), | ||
{ | ||
times: 1, | ||
}, | ||
); | ||
}); | ||
}); | ||
|
||
|
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.
New docs auto-generated for the externally exposed method and type for setting the SDK's log level