Skip to content

SDK-6118: Verbose Console Logs - #65

Draft
akashvercetti wants to merge 2 commits into
developfrom
SDK-6118-console-logs
Draft

SDK-6118: Verbose Console Logs#65
akashvercetti wants to merge 2 commits into
developfrom
SDK-6118-console-logs

Conversation

@akashvercetti

@akashvercetti akashvercetti commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Logging setup

New CTContentLog class. Uses os_log with subsystem com.clevertap.sdk.
Always on. No setting to turn it on or off.
Every line uses level .default. That level is saved to disk. A client can send us the log after a bug.
Every line shows the file and method it came from.
Checked that the lines survive in a stripped Release build. SPM users get them too.

Extension startup
First line logs that the extension started. No lines at all means it never ran.
Logs the notification id and all payload keys.
Logs which template was picked, and why.
Logs when pt_id is missing, unknown, or the wrong type.
Logs when pt_json is missing or wrong. Logs when we rebuild it from flat keys.
Logs a size of zero. That is why the expanded view shows up blank.
Logs a memory warning. The system stops the extension soon after one.
Logs the response option by name, not as a number.

New payload check like Android Push templates
Runs before any drawing or download.
Names every missing key in one line. Says what the user will see.
Covers basic, both carousels, timer, zero bezel, web view, rating, vertical image.

Images
Logs the start, the size, the byte count, and the time taken.
Logs each failure on its own: bad url, network error, bad status, empty body, decode failure.
Added a 10 second timeout. The old 60 second one was longer than the extension lives. A slow download killed the process with no log.

Templates
Carousel: image count, skipped slides, page index, deeplink taps.
Timer: which key set the deadline, and its values.
WebView: page load start, failure, and finish.
All other templates: missing images and caption-only fallbacks.

Fixes, not only logs
A payload value of the wrong type no longer stops the decode.
Empty view lists and decode failures now have handling.

Docs
README has the log stream command.
README warns that Console.app hides these lines under Errors and Faults.

@coderabbitai

@shubhambjadhavar

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@akashvercetti

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants