mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 22:00:49 +01:00
Winni Neessen
6633591b51
As stated in https://github.com/wneessen/go-mail/pull/102#issuecomment-1411956040 it would be beneficial if, instead of forcing the Go stdlib logger on the user to provide a simple interface and use that for logging purposes. This PR implements this simple log.Logger interface as well as a standard logger that satisfies this interface. If no custom logger is provided, the Stdlog will be used (which makes use of the Go stdlib again). Accordingly, a `Client.WithLogger` and `Client.SetLogger` have been implemented. Same applies for the smtp counterparts.
14 lines
440 B
Go
14 lines
440 B
Go
// SPDX-FileCopyrightText: Copyright (c) 2022-2023 The go-mail Authors
|
|
//
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
// Package log implements a logger interface that can be used within the go-mail package
|
|
package log
|
|
|
|
// Logger is the log interface for go-mail
|
|
type Logger interface {
|
|
Errorf(format string, v ...interface{})
|
|
Warnf(format string, v ...interface{})
|
|
Infof(format string, v ...interface{})
|
|
Debugf(format string, v ...interface{})
|
|
}
|