-
Notifications
You must be signed in to change notification settings - Fork 41
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: improve ama-sdk plugins logging #1184
Conversation
packages/@ama-sdk/core/src/plugins/session-id/session-id.request.ts
Outdated
Show resolved
Hide resolved
packages/@ama-sdk/core/src/plugins/pii-tokenizer/pii-tokenizer.request.ts
Show resolved
Hide resolved
...s/@ama-sdk/core/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.ts
Show resolved
Hide resolved
@@ -63,7 +63,7 @@ export class ApiAngularClient implements ApiClient { | |||
let opts = options; | |||
if (this.options.requestPlugins) { | |||
for (const plugin of this.options.requestPlugins) { | |||
opts = await plugin.load().transform(opts); | |||
opts = await plugin.load({logger: this.options.logger}).transform(opts); |
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.
could be simplified to
opts = await plugin.load({logger: this.options.logger}).transform(opts); | |
opts = await plugin.load(this.options).transform(opts); |
...s/@ama-sdk/core/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.ts
Outdated
Show resolved
Hide resolved
packages/@ama-sdk/core/src/plugins/session-id/session-id.request.ts
Outdated
Show resolved
Hide resolved
packages/@ama-sdk/core/src/plugins/session-id/session-id.request.ts
Outdated
Show resolved
Hide resolved
780e12c
to
5118e9f
Compare
packages/@ama-sdk/core/src/plugins/session-id/session-id.request.ts
Outdated
Show resolved
Hide resolved
5118e9f
to
636b177
Compare
636b177
to
537c8e3
Compare
packages/@ama-sdk/core/src/plugins/session-id/session-id.request.ts
Outdated
Show resolved
Hide resolved
packages/@ama-sdk/core/src/plugins/session-id/session-id.request.ts
Outdated
Show resolved
Hide resolved
537c8e3
to
ad25371
Compare
packages/@ama-sdk/core/src/plugins/session-id/session-id.request.ts
Outdated
Show resolved
Hide resolved
ad25371
to
252c8ee
Compare
packages/@ama-sdk/core/package.json
Outdated
@@ -76,6 +77,9 @@ | |||
"@angular/common": { | |||
"optional": true | |||
}, | |||
"@o3r/core": { | |||
"optional": true |
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.
is it really optional ?
regardless, @o3r/core
should also be added in the devDependencies generated by the @ama-sdk/schematics:typescript-shell https://github.com/AmadeusITGroup/otter/blob/release/10.0.0-next/packages/%40ama-sdk/schematics/schematics/typescript/shell/templates/base/package.json.template#L79
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 it is optional since it is only used to import types (Logger
from @o3r/core
)
252c8ee
to
e93b3bf
Compare
2ebc079
to
ecec776
Compare
ecec776
to
686ac66
Compare
* @param message Message to log | ||
* @param optionalParams Optional parameters to log | ||
*/ | ||
error(message?: any, ...optionalParams: any[]): void; |
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.
Maybe it could be valuable to have the this: Logger
as first param to avoid le context loosing usage
686ac66
to
dfdcdb2
Compare
## Proposed change Cherry-pick of #1184 on 9.6
Proposed change
Possibility to connect a third-party logger in ama-sdk, fallback to console logger if undefined.
Related issues