chore: added push log faro wrapper function captureLog (#40539)

## Description
> [!TIP]  
> _Add a TL;DR when the description is longer than 500 words or
extremely technical (helps the content, marketing, and DevRel team)._
>
> _Please also include relevant motivation and context. List any
dependencies that are required for this change. Add links to Notion,
Figma or any other documents that might be relevant to the PR._


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.Sanity"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/14776408755>
> Commit: acd4de6042b9ca6e4112d9e59371096d8e8a2b93
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14776408755&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Thu, 01 May 2025 14:26:46 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Enhanced telemetry with improved log capture, allowing for structured
logging with customizable log levels and additional context.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Apeksha Bhosale 2025-05-02 11:54:14 +05:30 committed by GitHub
parent d0bfac3e8a
commit 4310890028
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -179,6 +179,25 @@ class AppsmithTelemetry {
errorLogger(e); errorLogger(e);
} }
} }
public captureLog(
args: unknown[],
level: LogLevel = LogLevel.INFO,
context?: Record<string, string>,
) {
if (!this.faro) {
return;
}
try {
this.faro.api.pushLog(args, {
level,
context,
});
} catch (e) {
errorLogger(e);
}
}
} }
export const appsmithTelemetry = AppsmithTelemetry.getInstance(); export const appsmithTelemetry = AppsmithTelemetry.getInstance();