aigoncharov / cls-proxify

Logging on steroids with CLS and Proxy. Integrated with express, koa, fastify.
MIT License
160 stars 7 forks source link

FR: provide namespace to use #3

Closed ofer-papaya closed 2 years ago

ofer-papaya commented 5 years ago

There are cases when the app already has a namespace and it would be very helpful to use the same namespace in cls proxify.

aigoncharov commented 5 years ago

@ofer-papaya what would be the use case? I mean my current thinking is that namespaces were introduced to provide an incapsulated environment for every library to avoid any conflicts. How using a dedicated namespace for cls-proxify is affecting your app? Namespaces should work together without any issues.

ofer-papaya commented 5 years ago

@keenondrums it might be an issue with cls-hooked but when we used multiple nested namespaces we got incorrect values so it looks like it's better to use a single namespace for the entire app. Providing the namespace has an additional value that it will decouple cls-proxify from cls-hooked and in case that there will be a new library as in the case that happened with continuation-local-storage and cls-hooked it will still be relevant.