mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-09 07:26:48 +00:00
New logging system (#319)
* First pass at adding new logging system * NewLogger * NewLogger * WIP * silly bug fix * :D removed files * removed old logging interface * added tests * added tests * Started to add new lines to all f calls * Added subsystem log types * Logger improvements * Further performance improvements * changes to logger and sublogger creation * Renamed Logging types * removed old print statement * changes based on feedback * moved sublogger types to own file * :) * added console as output type * added get level command * added get/set log level via grpc command * added check for output being empty for migration support * first pass at log rotation * added log rotation * :D derp fixed * added tests * changes based on feedback * changed log type * comments * renamed file -> fileSettings * typo fix * changes based on feedback * gofmt ran on additional files * gofmt ran on additional files
This commit is contained in:
@@ -29,10 +29,10 @@ func (c IComm) Setup() {
|
||||
if c[i].IsEnabled() && !c[i].IsConnected() {
|
||||
err := c[i].Connect()
|
||||
if err != nil {
|
||||
log.Errorf("Communications: %s failed to connect. Err: %s", c[i].GetName(), err)
|
||||
log.Errorf(log.CommunicationMgr, "Communications: %s failed to connect. Err: %s", c[i].GetName(), err)
|
||||
continue
|
||||
}
|
||||
log.Debugf("Communications: %v is enabled and online.", c[i].GetName())
|
||||
log.Debugf(log.CommunicationMgr, "Communications: %v is enabled and online.", c[i].GetName())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ func (c IComm) PushEvent(event Event) {
|
||||
if c[i].IsEnabled() && c[i].IsConnected() {
|
||||
err := c[i].PushEvent(event)
|
||||
if err != nil {
|
||||
log.Errorf("Communications error - PushEvent() in package %s with %v. Err %s",
|
||||
log.Errorf(log.CommunicationMgr, "Communications error - PushEvent() in package %s with %v. Err %s",
|
||||
c[i].GetName(), event, err)
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ func (c IComm) GetEnabledCommunicationMediums() error {
|
||||
var count int
|
||||
for i := range c {
|
||||
if c[i].IsEnabled() && c[i].IsConnected() {
|
||||
log.Debugf("Communications: Medium %s is enabled.", c[i].GetName())
|
||||
log.Debugf(log.CommunicationMgr, "Communications: Medium %s is enabled.", c[i].GetName())
|
||||
count++
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user