You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Integrate logger client into cdp-client with service-based discovery
Bundle cdplogger-client as studio.logger and add client.logger() method
that discovers loggers via ServicesNotification and connects through
proxy transport via makeServiceTransport (CDP 5.1+).
- client.logger(name, options): auto-discovers logserver proxy service
across all connections including sibling apps via proxy
- client.loggers(): returns all discovered logger services
- Sibling app discovery: searches all AppConnections, not just primary;
serviceUpdateListeners fire on all connections; poll interval catches
new siblings that appear after initial listener registration
- Dead connection guard: isConnectionAlive() skips connections whose
transport is closed, preventing stale service discovery
- Caching by name with eviction on transport close; stale promise
cleanup via .then(clearPromise, clearPromise) on both resolve/reject
- close() disconnects cached loggers and rejects pending promises
- Error() rejections matching existing find()/onConnect() patterns
- Proto files use raw .proto.js format matching studioapi.proto.js
- Standalone files from import removed (client.js, package.json,
generated/, test/, .github/, QUICKSTART.md, README.md)
- DOCUMENTATION.md updated for bundled context
- Unit tests adapted from cdplogger-client test suite
- README.rst Logger Integration section with API docs and examples
- Examples (event.js, value.js) updated for proxy-based discovery
The logger client returned by ``client.logger()`` provides these methods:
958
+
959
+
- ``requestApiVersion()`` - Returns Promise with the logger API version string.
960
+
- ``requestLoggedNodes()`` - Returns Promise with array of ``{ name, routing, tags }`` for each logged signal.
961
+
- ``requestLogLimits()`` - Returns Promise with ``{ startS, endS }`` — the earliest and latest logged timestamps in seconds.
962
+
- ``requestDataPoints(nodeNames, startS, endS, noOfDataPoints, limit)`` - Returns Promise with array of data points. Each point has ``{ timestamp, value }`` where value maps signal names to ``{ min, max, last }``.
963
+
- ``requestEvents(query)`` - Returns Promise with array of events. Query supports ``limit``, ``offset``, ``flags``, ``timeRangeBegin``, ``timeRangeEnd``, ``codeMask``, ``senderConditions``, ``dataConditions``.
964
+
- ``countEvents(query)`` - Returns Promise with the count of matching events.
965
+
- ``getEventCodeDescription(code)`` - Returns human-readable description for an event code (e.g. ``"AlarmSet + SourceObjectUnavailable"``).
0 commit comments