Skip to content

Commit

Permalink
Remove Realm, Region and AZ from default env
Browse files Browse the repository at this point in the history
  • Loading branch information
dongxuny committed Mar 16, 2022
1 parent c74d12a commit 07d0c69
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 14 deletions.
3 changes: 0 additions & 3 deletions constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ const (
envKey = "env"
hostnameKey = "hostname"
localIpKey = "localIP"
realmKey = "realm"
regionKey = "region"
azKey = "az"
domainKey = "domain"
goosKey = "os"
goArchKey = "arch"
Expand Down
6 changes: 0 additions & 6 deletions event_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ const (
)

var (
realm = ""
region = ""
az = ""
domain = ""
localIp = getLocalIP()
hostname = getHostName()
Expand Down Expand Up @@ -153,9 +150,6 @@ func NewEventFactory(option ...EventOption) *EventFactory {
options: option,
}

realm = getDefaultIfEmptyString(os.Getenv("REALM"), "*")
region = getDefaultIfEmptyString(os.Getenv("REGION"), "*")
az = getDefaultIfEmptyString(os.Getenv("AZ"), "*")
domain = getDefaultIfEmptyString(os.Getenv("DOMAIN"), "*")

return factory
Expand Down
3 changes: 0 additions & 3 deletions event_zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,6 @@ func (event *eventZap) envToMapObjectEncoder() *zapcore.MapObjectEncoder {
enc := zapcore.NewMapObjectEncoder()
enc.AddString(hostnameKey, hostname)
enc.AddString(localIpKey, localIp)
enc.AddString(realmKey, realm)
enc.AddString(regionKey, region)
enc.AddString(azKey, az)
enc.AddString(domainKey, domain)
enc.AddString(goosKey, goos)
enc.AddString(goArchKey, goArch)
Expand Down
4 changes: 2 additions & 2 deletions example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ var (
)

func main() {
withEventFlattenEncoding()
//withEventConsoleEncoding()
//withEventFlattenEncoding()
withEventConsoleEncoding()
//withEventJSONEncoding()
//withEventHelper()
}
Expand Down

0 comments on commit 07d0c69

Please sign in to comment.