mirror of
https://github.com/IBM/fp-go.git
synced 2025-06-23 00:27:49 +02:00
initial checkin
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
18
logging/logger.go
Normal file
18
logging/logger.go
Normal file
@ -0,0 +1,18 @@
|
||||
package Logging
|
||||
|
||||
import (
|
||||
"log"
|
||||
)
|
||||
|
||||
func LoggingCallbacks(loggers ...*log.Logger) (func(string, ...any), func(string, ...any)) {
|
||||
switch len(loggers) {
|
||||
case 0:
|
||||
def := log.Default()
|
||||
return def.Printf, def.Printf
|
||||
case 1:
|
||||
log0 := loggers[0]
|
||||
return log0.Printf, log0.Printf
|
||||
default:
|
||||
return loggers[0].Printf, loggers[1].Printf
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user