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

Added some functions to make it easier to migrate from Pitaya V1 #376

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

guthyerrz
Copy link
Member

No description provided.

// New returns a new session instance
// a NetworkEntity is a low-level network instance
func New(entity networkentity.NetworkEntity, frontend bool, UID ...string) Session {
DefaultSessionPool = NewSessionPool()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it intended that you are resetting the DefaultSessionPool every time you create a new session isntance?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll remove this method, It doesn't make sense to be here I just used it for testing on Zooba

@@ -29,4 +31,6 @@ type Logger interface {
WithFields(fields map[string]interface{}) Logger
WithField(key string, value interface{}) Logger
WithError(err error) Logger

LogrusLogger() logrus.FieldLogger
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain the need for this method? It sounds a bit weird that we are tying our generic Logger interface to Logrus

Copy link
Member Author

Choose a reason for hiding this comment

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

So in a few places I need to get the internal logger that this interface uses, how about this?

GetInternalLogger() any

Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we define the internal logger as another interface rather than using any?

Copy link
Member Author

Choose a reason for hiding this comment

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

Like this GetInternalLogger() logrus.FieldLogger

Copy link
Contributor

Choose a reason for hiding this comment

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

no because this interface is too extensive and use internal logrus stuff

@coveralls
Copy link

coveralls commented Dec 15, 2023

Pull Request Test Coverage Report for Build 7225116265

  • 3 of 5 (60.0%) changed or added relevant lines in 1 file are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.002%) to 61.679%

Changes Missing Coverage Covered Lines Changed/Added Lines %
static.go 3 5 60.0%
Files with Coverage Reduction New Missed Lines %
modules/binary.go 4 73.91%
Totals Coverage Status
Change from base Build 7132005378: 0.002%
Covered Lines: 4848
Relevant Lines: 7860

💛 - Coveralls

logger/interfaces/interfaces.go Outdated Show resolved Hide resolved
@felipejfc felipejfc merged commit cc949c4 into main Dec 15, 2023
4 checks passed
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