-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(registry): add structured logs support #531
Conversation
00cb74e
to
56084f2
Compare
registry/server/index.ts
Outdated
@@ -1,16 +1,39 @@ | |||
import path from 'path'; | |||
|
|||
['log', 'warn', 'error'].forEach(function (method) { |
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 code looks a little bit not transparent to me. Could you please leave a comment why is it written in this way and explaining what does it do
registry/server/index.ts
Outdated
|
||
(async () => { | ||
try { | ||
loadPlugins(); |
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 see that loadPlugins()
is called 2 times here and inside app()
. Is it done intentionally?
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.
fixed
|
||
const loggerProxyHandler: ProxyHandler<Logger> = { | ||
get(target, prop) { | ||
const requestIdKey = getPluginManagerInstance().getReportingPlugin().requestIdLogLabel ?? 'operationId'; |
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.
it seems that this one is needed only inside if
body
registry/server/util/logger.ts
Outdated
get(target, prop) { | ||
const requestIdKey = getPluginManagerInstance().getReportingPlugin().requestIdLogLabel ?? 'operationId'; | ||
const origMethod = hasKey(target, prop) && target[prop]; | ||
if (typeof origMethod === 'function') { |
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 you please invert condition to reduce nesting. And probably in order not to break to much, the else
case should be handled as well
|
||
export function loadPlugins() { | ||
if (!pluginManagerInstance) { | ||
pluginManagerInstance = new PluginManager(...manifest.manifest.plugins); |
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 there any potential issue to initialize it directly in module?
i.e. const pluginManagerInstance = new PluginManager(...)
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.
it will be triggered in the import ESM module phase, so it makes it harder to control flow.
236ced2
to
e1cf6bb
Compare
Add ilc-plugins-sdk partial support
e1cf6bb
to
1ccba2c
Compare
Coverage ReportIlc/serverCommit SHA:f267a99f64ea16f641031d071d280bbd7f53b624 Test coverage results 🧪
File details
Ilc/clientCommit SHA:f267a99f64ea16f641031d071d280bbd7f53b624 Test coverage results 🧪
File details
RegistryCommit SHA:f267a99f64ea16f641031d071d280bbd7f53b624 Test coverage results 🧪
File details
|
No description provided.