objectName returns a new that is usable to identify the used external component (module or some stub) in debug logs.
(x interface{})
| 27 | // objectName returns a new that is usable to identify the used external |
| 28 | // component (module or some stub) in debug logs. |
| 29 | func objectName(x interface{}) string { |
| 30 | mod, ok := x.(module.Module) |
| 31 | if ok { |
| 32 | return mod.Name() + ":" + mod.InstanceName() |
| 33 | } |
| 34 | |
| 35 | _, pipeline := x.(*MsgPipeline) |
| 36 | if pipeline { |
| 37 | return "reroute" |
| 38 | } |
| 39 | |
| 40 | str, ok := x.(fmt.Stringer) |
| 41 | if ok { |
| 42 | return str.String() |
| 43 | } |
| 44 | |
| 45 | return fmt.Sprintf("%T", x) |
| 46 | } |
no test coverage detected