2023-02-27 12:20:07 +01:00
|
|
|
package formatter
|
|
|
|
|
|
|
|
import "github.com/sirupsen/logrus"
|
|
|
|
|
2023-03-17 10:37:27 +01:00
|
|
|
// SetTextFormatter set the text formatter for given logger.
|
2023-02-27 12:20:07 +01:00
|
|
|
func SetTextFormatter(logger *logrus.Logger) {
|
|
|
|
logger.Formatter = NewTextFormatter()
|
|
|
|
logger.ReportCaller = true
|
|
|
|
logger.AddHook(NewContextHook())
|
|
|
|
}
|
2023-03-17 10:37:27 +01:00
|
|
|
|
|
|
|
// SetLogcatFormatter set the logcat formatter for given logger.
|
|
|
|
func SetLogcatFormatter(logger *logrus.Logger) {
|
|
|
|
logger.Formatter = NewLogcatFormatter()
|
|
|
|
logger.ReportCaller = true
|
|
|
|
logger.AddHook(NewContextHook())
|
|
|
|
}
|