mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
log: Add structured logging (#1171)
* basic implementation * log: deprecate duplicate function, add tests and refine calls. * linter: fixes * linter: update struct * linter and new type * log tests: update to not lint issue * linter: stop complaining please * glorious: nits * log: rm comment code * glorious: nits * glorious: nits * glorious: nits * glorious: nits missed --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
@@ -35,7 +35,7 @@ func Event(res *withdraw.Response) {
|
||||
|
||||
exchangeUUID, err := exchangeDB.UUIDByName(res.Exchange.Name)
|
||||
if err != nil {
|
||||
log.Error(log.DatabaseMgr, err)
|
||||
log.Errorln(log.DatabaseMgr, err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ func GetEventByUUID(id string) (*withdraw.Response, error) {
|
||||
func GetEventsByExchange(exchange string, limit int) ([]*withdraw.Response, error) {
|
||||
exch, err := exchangeDB.UUIDByName(exchange)
|
||||
if err != nil {
|
||||
log.Error(log.DatabaseMgr, err)
|
||||
log.Errorln(log.DatabaseMgr, err)
|
||||
return nil, err
|
||||
}
|
||||
return getByColumns(generateWhereQuery([]string{"exchange_name_id"}, []string{exch.String()}, limit))
|
||||
@@ -242,7 +242,7 @@ func GetEventsByExchange(exchange string, limit int) ([]*withdraw.Response, erro
|
||||
func GetEventByExchangeID(exchange, id string) (*withdraw.Response, error) {
|
||||
exch, err := exchangeDB.UUIDByName(exchange)
|
||||
if err != nil {
|
||||
log.Error(log.DatabaseMgr, err)
|
||||
log.Errorln(log.DatabaseMgr, err)
|
||||
return nil, err
|
||||
}
|
||||
resp, err := getByColumns(generateWhereQuery([]string{"exchange_name_id", "exchange_id"}, []string{exch.String(), id}, 1))
|
||||
@@ -260,7 +260,7 @@ func GetEventsByDate(exchange string, start, end time.Time, limit int) ([]*withd
|
||||
}
|
||||
exch, err := exchangeDB.UUIDByName(exchange)
|
||||
if err != nil {
|
||||
log.Error(log.DatabaseMgr, err)
|
||||
log.Errorln(log.DatabaseMgr, err)
|
||||
return nil, err
|
||||
}
|
||||
return getByColumns(append(generateWhereQuery([]string{"exchange_name_id"}, []string{exch.String()}, 0), betweenQuery...))
|
||||
|
||||
Reference in New Issue
Block a user