feat: [Fireflies] log cleanly#15618
Merged
charlesBochet merged 2 commits intotwentyhq:mainfrom Nov 5, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR introduces a configurable logging system for the Fireflies integration, replacing scattered console.log and console.error calls with a centralized AppLogger class.
Key Changes
- Implemented
AppLoggerclass with configurable log levels (debug, info, warn, error, silent, critical) - Replaced
DEBUG_LOGSboolean environment variable withLOG_LEVELenum for granular control - Added automatic test environment detection to prevent log noise during testing
- Enhanced error messages with context-aware logging prefixes
- Improved participant name extraction logic in
fireflies-api-client.ts
Issues Found
- Critical: The
debugarray inWebhookHandleris no longer populated after removing thelogDebug/logErrormethods, but is still returned inresult.debug. This will always be empty now.
Confidence Score: 4/5
- This PR is mostly safe to merge with one minor issue to address
- The logging refactoring is well-implemented with proper log levels and test environment handling. However, the
debugarray inWebhookHandleris no longer populated, which could break functionality that depends onresult.debug. This is a minor issue that should be fixed before merging. - Pay attention to
webhook-handler.ts- the debug array needs to be either removed or properly populated
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| packages/twenty-apps/hacktoberfest-2025/fireflies/serverlessFunctions/receive-fireflies-notes/src/webhook-handler.ts | 3/5 | Replaced old logging methods with new logger system, but debug array is no longer populated |
| packages/twenty-apps/hacktoberfest-2025/fireflies/serverlessFunctions/receive-fireflies-notes/src/logger.ts | 5/5 | New logger implementation with configurable log levels and test environment detection - looks good |
| packages/twenty-apps/hacktoberfest-2025/fireflies/serverlessFunctions/receive-fireflies-notes/src/fireflies-api-client.ts | 5/5 | Replaced console.log/error with logger calls, improved name extraction logic in participant parsing |
Sequence Diagram
sequenceDiagram
participant WH as WebhookHandler
participant Logger as AppLogger
participant FA as FirefliesApiClient
participant TC as TwentyCrmService
participant ENV as Environment
WH->>Logger: createLogger('fireflies')
Logger->>ENV: Check LOG_LEVEL & NODE_ENV
ENV-->>Logger: Return config
WH->>Logger: debug('invoked')
Logger->>Logger: shouldLog('debug')?
alt LOG_LEVEL allows debug
Logger->>Console: console.log('[fireflies] invoked')
else LOG_LEVEL too high or test env
Logger-->>WH: (suppressed)
end
WH->>FA: new FirefliesApiClient(apiKey)
FA->>Logger: createLogger('fireflies-api')
WH->>FA: fetchMeetingDataWithRetry()
FA->>Logger: debug('fetching meeting...')
FA-->>WH: meetingData
WH->>TC: new TwentyCrmService(apiKey)
TC->>Logger: createLogger('20 CRM Service')
WH->>TC: matchParticipantsToContacts()
TC->>Logger: warn('Duplicate email...')
TC-->>WH: matched contacts
WH->>TC: createMeeting()
TC->>Logger: debug('createMeeting variables')
TC-->>WH: meetingId
alt Error occurs
WH->>Logger: error('error: message')
Logger->>Console: console.error('[fireflies] error: message')
end
9 files reviewed, 1 comment
Comment on lines
18
to
19
| private debug: string[] = []; | ||
| private isTestEnvironment: boolean; |
Contributor
There was a problem hiding this comment.
logic: The debug array is no longer populated after removing logDebug and logError methods. result.debug will always be empty now. Consider removing this field entirely or add logic to populate it with logger messages.
Suggested change
| private debug: string[] = []; | |
| private isTestEnvironment: boolean; | |
| // Remove this field if debug tracking is no longer needed | |
| // private debug: string[] = []; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/twenty-apps/hacktoberfest-2025/fireflies/serverlessFunctions/receive-fireflies-notes/src/webhook-handler.ts
Line: 18:19
Comment:
**logic:** The `debug` array is no longer populated after removing `logDebug` and `logError` methods. `result.debug` will always be empty now. Consider removing this field entirely or add logic to populate it with logger messages.
```suggestion
// Remove this field if debug tracking is no longer needed
// private debug: string[] = [];
```
How can I resolve this? If you propose a fix, please make it concise.
charlesBochet
approved these changes
Nov 5, 2025
Contributor
|
Thanks @alex-galey for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

[0.2.2] - 2025-11-04
Added
AppLoggerclass with log level support (debug, info, warn, error, silent)LOG_LEVELenvironment variableEnhanced