Skip to content

Commit

Permalink
Merge pull request #12 from hkh4n/logging
Browse files Browse the repository at this point in the history
logging naming convention hotfix
  • Loading branch information
eyedeekay authored Oct 23, 2024
2 parents 5149b7e + 5be3e27 commit 97d1c81
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export DEBUG_I2P=warn
export DEBUG_I2P=error
```

If in case I2P_DEBUG is set to an unrecognized variable, it will fall back to "debug".
If I2P_DEBUG is set to an unrecognized variable, it will fall back to "debug".

## License ##

Expand Down
10 changes: 5 additions & 5 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var (
once sync.Once
)

func InitializeLogger() {
func InitializeSAM3Logger() {
once.Do(func() {
log = logrus.New()
// We do not want to log by default
Expand All @@ -37,14 +37,14 @@ func InitializeLogger() {
})
}

// GetLogger returns the initialized logger
func GetLogger() *logrus.Logger {
// GetSAM3Logger returns the initialized logger
func GetSAM3Logger() *logrus.Logger {
if log == nil {
InitializeLogger()
InitializeSAM3Logger()
}
return log
}

func init() {
InitializeLogger()
InitializeSAM3Logger()
}
2 changes: 1 addition & 1 deletion sam3.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

func init() {
InitializeLogger()
InitializeSAM3Logger()
}

// Used for controlling I2Ps SAMv3.
Expand Down
2 changes: 1 addition & 1 deletion suggestedOptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func PrimarySessionString() string {
var PrimarySessionSwitch string = PrimarySessionString()

func getEnv(key, fallback string) string {
InitializeLogger()
InitializeSAM3Logger()
value, ok := os.LookupEnv(key)
if !ok {
log.WithFields(logrus.Fields{
Expand Down

0 comments on commit 97d1c81

Please sign in to comment.