Skip to content
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

Understand Ably SDK developers’ requirements for information logged by the SDK #1623

Open
lawrence-forooghian opened this issue Apr 6, 2023 · 1 comment
Labels
enhancement New feature or improved functionality.
Milestone

Comments

@lawrence-forooghian
Copy link
Collaborator

lawrence-forooghian commented Apr 6, 2023

Background

Ably SDK developers are the primary consumers of the log messages emitted by the SDK. This normally occurs in the context of debugging the behaviour of the SDK, for example:

  • when writing automated tests that exercise the SDK
  • when writing other SDKs that exercise the SDK (for example, ably-asset-tracking-swift)
  • when helping users debug unexpected behaviours of the SDK

This issue aims to understand these users’ needs and how we might meet them.

User needs

Their primary need is to have information that helps them understand the observed behaviour of the SDK. This means that, from the log output, they need to be able to understand:

  1. the SDK’s inputs and outputs
  2. how the inputs led to the outputs

The SDK’s inputs are:

  • invocations of the methods that constitute its public API
  • events received from the network (transport events, received protocol messages, etc)
  • events received from the operating system (e.g. network connectivity status)
  • data loaded from disk (e.g. push machine state)

The SDK’s outputs are:

  • data emitted through the public API:
    • return values of public methods
    • calls to user-provided callbacks
  • interactions made with the network (opening a transport, sending protocol messages, etc)
  • data written to disk

The inputs lead to the outputs via:

  • interactions between internal SDK components
  • decisions made by internal SDK components

The log output needs to allow us to understand the above even in the case where there are potentially multiple instances of the SDK active at the same time (e.g. in test cases). That is, it should allow us to distinguish between logs emitted by different instances of the SDK.

Metadata

The log messages should be accompanied by generally-useful metadata:

  • from where in the codebase a log message was emitted; this means both:
    • the broad subsystem and its place in a hierarchy (e.g. "an ARTRealtimeChannel instance with address 0x6000000befc0, belonging to an ARTRealtime instance with address 0x6000000aedc3")
    • the code location (file and line number)
  • a tag describing which of the above input/output categories the log message belongs to, if any

Next steps

The next steps for this issue are to split it into actionable tasks. I suggest we approach the scoping and implementation in order of lowest-hanging fruit first — that is, starting with the work that can be done mechanically without requiring us to spend much time understanding the internals of the SDK.

We should also think through potential scenarios in which we would wish to request that the customer send us logs, and whether the requirements gathered above would give us confidence that the logs would help us diagnose the customer’s issue.

Current subtasks

Logging contextual information

Logging public API activity

┆Issue is synchronized with this Jira Task by Unito

@lawrence-forooghian lawrence-forooghian added this to the Logging milestone Apr 6, 2023
@sync-by-unito
Copy link

sync-by-unito bot commented Apr 6, 2023

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3502

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improved functionality.
Development

No branches or pull requests

2 participants