You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2020/08/19 12:18:35 UTC
[GitHub] [dubbo-go] cvictory commented on a change in pull request #713: [refer dubbo 2.7.6] attachment type from map[string]stiring to map[string]interface{}
cvictory commented on a change in pull request #713:
URL: https://github.com/apache/dubbo-go/pull/713#discussion_r472984586
##########
File path: filter/filter_impl/access_log_filter.go
##########
@@ -105,13 +105,27 @@ func (ef *AccessLogFilter) logIntoChannel(accessLogData AccessLogData) {
func (ef *AccessLogFilter) buildAccessLogData(_ protocol.Invoker, invocation protocol.Invocation) map[string]string {
dataMap := make(map[string]string, 16)
attachments := invocation.Attachments()
- dataMap[constant.INTERFACE_KEY] = attachments[constant.INTERFACE_KEY]
- dataMap[constant.METHOD_KEY] = invocation.MethodName()
- dataMap[constant.VERSION_KEY] = attachments[constant.VERSION_KEY]
- dataMap[constant.GROUP_KEY] = attachments[constant.GROUP_KEY]
- dataMap[constant.TIMESTAMP_KEY] = time.Now().Format(MessageDateLayout)
- dataMap[constant.LOCAL_ADDR], _ = attachments[constant.LOCAL_ADDR]
- dataMap[constant.REMOTE_ADDR], _ = attachments[constant.REMOTE_ADDR]
+ if attachments[constant.INTERFACE_KEY] != nil {
Review comment:
其实这种方式也可以,只是nil可能是取出来的值为nil或key不存在哈。
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org