2022-06-29 13:56:41 +00:00
|
|
|
package log
|
2015-10-10 07:29:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
func newContext(cascade ...interface{}) map[string]interface{} {
|
|
|
|
|
|
|
|
context := make(map[string]interface{})
|
|
|
|
|
|
|
|
for _,x := range cascade {
|
|
|
|
switch xx := x.(type) {
|
|
|
|
case map[string]string:
|
|
|
|
for key, value := range xx {
|
|
|
|
context[key] = value
|
|
|
|
}
|
|
|
|
case map[string]interface{}:
|
|
|
|
for key, value := range xx {
|
|
|
|
context[key] = value
|
|
|
|
}
|
|
|
|
case string:
|
|
|
|
context["text"] = xx
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return context
|
|
|
|
}
|