github.com/yoctocloud/packer@v0.6.2-0.20160520224004-e11a0a18423f/builder/azure/common/logutil/logfields.go (about)

     1  // Copyright (c) Microsoft Corporation. All rights reserved.
     2  // Licensed under the MIT License. See the LICENSE file in builder/azure for license information.
     3  
     4  package logutil
     5  
     6  import "fmt"
     7  
     8  type Fields map[string]interface{}
     9  
    10  func (f Fields) String() string {
    11  	var s string
    12  	for k, v := range f {
    13  		if sv, ok := v.(string); ok {
    14  			v = fmt.Sprintf("%q", sv)
    15  		}
    16  		s += fmt.Sprintf(" %s=%v", k, v)
    17  	}
    18  	return s
    19  }