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

Add atSign to log messages in at_client_sdk #869

Closed
gkc opened this issue Jan 5, 2023 · 4 comments · Fixed by #870
Closed

Add atSign to log messages in at_client_sdk #869

gkc opened this issue Jan 5, 2023 · 4 comments · Fixed by #870
Assignees
Labels
2 SP More than an hour less than a day enhancement New feature or request PR53 unplanned Unplanned work mid-sprint plan

Comments

@gkc
Copy link
Contributor

gkc commented Jan 5, 2023

Is your feature request related to a problem? Please describe.

Log messages don't include the atSign. This is problematic when, for example, debugging race conditions involving switching atSigns. Examples from #868

flutter: FINEST|2023-01-05 17:25:49.778987|Monitor|_messageHandler received data
flutter: FINEST|2023-01-05 17:25:49.780148|NotificationServiceImpl|DEBUG: notification: {"id":"-1","from":"@buzkashipanicky","to":"@buzkashipanicky","key":"statsNotification.@buzkashipanicky","value":"15","operation":"update","epochMillis":1672919749728,"messageType":"MessageType.key","isEncrypted":false}
flutter: FINER|2023-01-05 17:25:49.782116|SyncService|got stats notification in sync: 15
flutter: FINER|2023-01-05 17:25:50.100624|AtLookup|SENDING: stats:3:.atbuzz

Describe the solution you'd like

Would like the logger name to include the atSign so that the examples above would look more like this:

flutter: FINEST|2023-01-05 17:25:49.778987|Monitor (@atSign)|_messageHandler received data
flutter: FINEST|2023-01-05 17:25:49.780148|NotificationServiceImpl (@atSign)|DEBUG: notification: {"id":"-1","from":"@buzkashipanicky","to":"@buzkashipanicky","key":"statsNotification.@buzkashipanicky","value":"15","operation":"update","epochMillis":1672919749728,"messageType":"MessageType.key","isEncrypted":false}
flutter: FINER|2023-01-05 17:25:49.782116|SyncService (@atSign)|got stats notification in sync: 15
flutter: FINER|2023-01-05 17:25:50.100624|AtLookup (@atSign)|SENDING: stats:3:.atbuzz

Describe alternatives you've considered

No response

Additional context

No response

@gkc gkc added the enhancement New feature or request label Jan 5, 2023
@sitaram-kalluri
Copy link
Member

@gkc: Can we update the logger instances in all the class files as below:

late final AtSignLogger _logger;

// Inside the constructor, initialize the _logger as below,
_logger = AtSignLogger('NotificationServiceImpl | $currentAtSign ');

Made the changes in my local branch and here is the sample log snippet

FINER|2023-01-05 20:48:04.066893|NotificationServiceImpl | @sitaram |subscribe(regex: statsNotification, shouldDecrypt: false 
INFO|2023-01-05 20:54:10.415913|SyncService | @sitaram |Inside syncComplete. syncRequest.requestSource : SyncRequestSource.app ; syncRequest.onDone : null 
FINER|2023-01-05 20:54:10.417368|SyncService | @sitaram |clearing sync queue 
FINER|2023-01-05 20:55:03.141173|SyncService | @sitaram |got stats notification in sync: 114 

@gkc
Copy link
Contributor Author

gkc commented Jan 5, 2023

Hi @sitaram-kalluri yes that's what I'm planning. I've got a branch where I've made all the changes but the format is like NotificationServiceImpl ($currentAtSign)

@sitaram-kalluri
Copy link
Member

Ok Gary.

@gkc gkc self-assigned this Jan 9, 2023
@gkc gkc added unplanned Unplanned work mid-sprint plan 3 SP 3 Story Points - 1 Day Small and removed 3 SP 3 Story Points - 1 Day Small labels Jan 9, 2023
@gkc
Copy link
Contributor Author

gkc commented Jan 9, 2023

3SP spent during PR52. Moving to PR53 and estimating as 2SP to get PR reviewed and merged

@gkc gkc added the 2 SP More than an hour less than a day label Jan 9, 2023
@ksanty ksanty added the PR53 label Jan 9, 2023
@gkc gkc closed this as completed in #870 Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 SP More than an hour less than a day enhancement New feature or request PR53 unplanned Unplanned work mid-sprint plan
Projects
None yet
3 participants