added put/get and auth examples to README, added Err(err) debug wrapper
This commit is contained in:
16
logger.go
16
logger.go
@@ -17,23 +17,23 @@ var messageWriter io.Writer = os.Stdout
|
||||
var accessWriter io.Writer = os.Stdout
|
||||
|
||||
func logDebug(messages ...any) {
|
||||
stamp := time.Now().Format(time.RFC3339Nano)
|
||||
fmt.Fprintln(messageWriter, stamp, "debug", messages)
|
||||
stamp := time.Now().Format(time.RFC3339)
|
||||
fmt.Fprintln(messageWriter, stamp, "dsrpc debug", messages)
|
||||
}
|
||||
|
||||
func logInfo(messages ...any) {
|
||||
stamp := time.Now().Format(time.RFC3339Nano)
|
||||
fmt.Fprintln(messageWriter, stamp, "info", messages)
|
||||
stamp := time.Now().Format(time.RFC3339)
|
||||
fmt.Fprintln(messageWriter, stamp, "dsrpc info", messages)
|
||||
}
|
||||
|
||||
func logError(messages ...any) {
|
||||
stamp := time.Now().Format(time.RFC3339Nano)
|
||||
fmt.Fprintln(messageWriter, stamp, "error", messages)
|
||||
stamp := time.Now().Format(time.RFC3339)
|
||||
fmt.Fprintln(messageWriter, stamp, "dsrpc error", messages)
|
||||
}
|
||||
|
||||
func logAccess(messages ...any) {
|
||||
stamp := time.Now().Format(time.RFC3339Nano)
|
||||
fmt.Fprintln(accessWriter, stamp, "access", messages)
|
||||
stamp := time.Now().Format(time.RFC3339)
|
||||
fmt.Fprintln(accessWriter, stamp, "dsrpc access", messages)
|
||||
}
|
||||
|
||||
func SetAccessWriter(writer io.Writer) {
|
||||
|
||||
Reference in New Issue
Block a user