Make all snowflake events LogSeverityNotice

Let's reserve Tor error logs for more severe events that indicate
a client-side bug or absolute failure. By default, tor logs at severity
level notice (and above).
This commit is contained in:
Cecylia Bocovich 2022-02-14 14:09:16 -05:00
parent 2c008d6589
commit 3547b284a9
No known key found for this signature in database
GPG key ID: 009DE379FD9B7B90

View file

@ -19,7 +19,7 @@ func (p ptEventLogger) OnNewSnowflakeEvent(e event.SnowflakeEvent) {
case event.EventOnOfferCreated:
e := e.(event.EventOnOfferCreated)
if e.Error != nil {
pt.Log(pt.LogSeverityError, fmt.Sprintf("offer creation failure %v", e.Error.Error()))
pt.Log(pt.LogSeverityNotice, fmt.Sprintf("offer creation failure %v", e.Error.Error()))
} else {
pt.Log(pt.LogSeverityNotice, fmt.Sprintf("offer created"))
}
@ -27,7 +27,7 @@ func (p ptEventLogger) OnNewSnowflakeEvent(e event.SnowflakeEvent) {
case event.EventOnBrokerRendezvous:
e := e.(event.EventOnBrokerRendezvous)
if e.Error != nil {
pt.Log(pt.LogSeverityError, fmt.Sprintf("broker failure %v", e.Error.Error()))
pt.Log(pt.LogSeverityNotice, fmt.Sprintf("broker failure %v", e.Error.Error()))
} else {
pt.Log(pt.LogSeverityNotice, fmt.Sprintf("broker rendezvous peer received"))
}
@ -37,7 +37,7 @@ func (p ptEventLogger) OnNewSnowflakeEvent(e event.SnowflakeEvent) {
case event.EventOnSnowflakeConnectionFailed:
e := e.(event.EventOnSnowflakeConnectionFailed)
pt.Log(pt.LogSeverityError, fmt.Sprintf("connection failed %v", e.Error.Error()))
pt.Log(pt.LogSeverityNotice, fmt.Sprintf("connection failed %v", e.Error.Error()))
}
}