Merge pull request #12 from hkh4n/logging

logging naming convention hotfix
This commit is contained in:
idk
2024-10-23 17:34:38 +00:00
committed by GitHub
4 changed files with 8 additions and 8 deletions

View File

@ -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 ##

10
log.go
View File

@ -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
@ -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()
}

View File

@ -19,7 +19,7 @@ import (
)
func init() {
InitializeLogger()
InitializeSAM3Logger()
}
// Used for controlling I2Ps SAMv3.

View File

@ -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{