MM-36764 mlog refactor (#18118)
Refactor mlog - simplify mlog by removing redundant code - remove Zap dependency - update unit test helpers - update logging config - update auditing
Этот коммит содержится в:
@@ -4,14 +4,13 @@
|
||||
package testlib
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// AssertLog asserts that a JSON-encoded buffer of logs contains one with the given level and message.
|
||||
func AssertLog(t *testing.T, logs *bytes.Buffer, level, message string) {
|
||||
func AssertLog(t *testing.T, logs io.Reader, level, message string) {
|
||||
dec := json.NewDecoder(logs)
|
||||
for {
|
||||
var log struct {
|
||||
@@ -33,7 +32,7 @@ func AssertLog(t *testing.T, logs *bytes.Buffer, level, message string) {
|
||||
}
|
||||
|
||||
// AssertNoLog asserts that a JSON-encoded buffer of logs does not contains one with the given level and message.
|
||||
func AssertNoLog(t *testing.T, logs *bytes.Buffer, level, message string) {
|
||||
func AssertNoLog(t *testing.T, logs io.Reader, level, message string) {
|
||||
dec := json.NewDecoder(logs)
|
||||
for {
|
||||
var log struct {
|
||||
|
||||
Ссылка в новой задаче
Block a user