mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
client: only log when logger is non-nil
This commit is contained in:
parent
abb3709a18
commit
7699c32258
@ -13,21 +13,31 @@ func (c *QQClient) SetLogger(logger Logger) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *QQClient) info(msg string, args ...any) {
|
func (c *QQClient) info(msg string, args ...any) {
|
||||||
c.logger.Info(msg, args...)
|
if c.logger != nil {
|
||||||
|
c.logger.Info(msg, args...)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *QQClient) warning(msg string, args ...any) {
|
func (c *QQClient) warning(msg string, args ...any) {
|
||||||
c.logger.Warning(msg, args...)
|
if c.logger != nil {
|
||||||
|
c.logger.Warning(msg, args...)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *QQClient) error(msg string, args ...any) {
|
func (c *QQClient) error(msg string, args ...any) {
|
||||||
c.logger.Error(msg, args...)
|
if c.logger != nil {
|
||||||
|
c.logger.Error(msg, args...)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *QQClient) debug(msg string, args ...any) {
|
func (c *QQClient) debug(msg string, args ...any) {
|
||||||
c.logger.Debug(msg, args...)
|
if c.logger != nil {
|
||||||
|
c.logger.Debug(msg, args...)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *QQClient) dump(msg string, data []byte, args ...any) {
|
func (c *QQClient) dump(msg string, data []byte, args ...any) {
|
||||||
c.logger.Dump(data, msg, args...)
|
if c.logger != nil {
|
||||||
|
c.logger.Dump(data, msg, args...)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user