Skip to content

Conversation

@gasperzgonec
Copy link
Contributor

Description

This PR changes how the SDK internal logs are printed. As it currently stands, the SDK logs are all prefixed with SDK: .

Connected Issues

Checklist

  • Tests added/updated and ran with npm run test OR no tests needed.
  • Ran backwards compatibility tests with npm run test:backwards-compatibility.
  • no-docs
  • Tested airdrop-template linked to this PR.

@gasperzgonec gasperzgonec marked this pull request as draft September 25, 2025 12:04
@gasperzgonec gasperzgonec marked this pull request as ready for review October 2, 2025 08:04
Copy link
Collaborator

@radovanjorgic radovanjorgic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I don't understand this whole complexity behind. So, what we want achieve is just prefixing SDK logs with [SDK] or sth like that, and possibly user logs with [USER]. Most likely I don't understand security issues here, but seems a bit like an overkill to me and sth that can overcomplicate our lifes. Let's discuss this on call.

@gasperzgonec gasperzgonec force-pushed the gasperz/ISS202822 branch 2 times, most recently from 6c7d0fc to 51e57d8 Compare October 9, 2025 13:31
Copy link
Collaborator

@radovanjorgic radovanjorgic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added few suggestions, will probably add more comments in second review. However, since logger overrides console, can we use console.log/error/warn... at all other places, let's have clear distinction here?

Also, let's ask @navneel99 for quick review after tomorrow's meeting.

@radovanjorgic radovanjorgic marked this pull request as draft October 20, 2025 08:47
@gasperzgonec
Copy link
Contributor Author

The code has been rewritten to support new linting addition.
I've kept the Token approach, but added the factory pattern for accessing internal or user logger.

Functions inside of logger.ts are private and aren't exported, so the access to the function is prevented. If user decided to import the source from the repo and wanted to spin up a new instance of Logger, the token would be incorrect and the creation would fail.

With the new changes:

  • tests pass
  • it is backward compatible
  • it's been linted
  • tested with airdrop-template

@gasperzgonec gasperzgonec marked this pull request as ready for review November 3, 2025 14:15
Copy link
Collaborator

@radovanjorgic radovanjorgic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added few comments, looks much better now.

Copy link
Collaborator

@radovanjorgic radovanjorgic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, please test in both local mode and on lambda.

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