當前位置: 首頁>>代碼示例>>Golang>>正文


Golang LogString.AddS方法代碼示例

本文整理匯總了Golang中Gateway311/engine/common.LogString.AddS方法的典型用法代碼示例。如果您正苦於以下問題:Golang LogString.AddS方法的具體用法?Golang LogString.AddS怎麽用?Golang LogString.AddS使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Gateway311/engine/common.LogString的用法示例。


在下文中一共展示了LogString.AddS方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: String

// String displays the contents of the CreateReqBase type.
func (c CreateReq) String() string {
	ls := new(common.LogString)
	ls.AddS("Report - CreateReq\n")
	ls.AddF("Backend: %s\n", c.bkend)
	ls.AddS(c.CreateReqBase.String())
	return ls.Box(90)
}
開發者ID:radhikapc,項目名稱:open311_gateway,代碼行數:8,代碼來源:create.go

示例2: String

// Displays the contents of the Spec_Type custom type.
func (u ICreateReqResp) String() string {
	ls := new(common.LogString)
	ls.AddS("ICreateReqResp\n")
	ls.AddF("Message: %v\n", u.Message)
	ls.AddF("ID: %v  AuthorID: %v\n", u.ID, u.AuthorID)
	return ls.Box(80)
}
開發者ID:radhikapc,項目名稱:open311_gateway,代碼行數:8,代碼來源:create.go

示例3: String

// Displays the contents of the Spec_Type custom type.
func (c ServicesReq) String() string {
	ls := new(common.LogString)
	ls.AddS("Services\n")
	ls.AddF("JID: %v\n", c.JID)
	ls.AddF("Location - lat: %v  lon: %v  city: %v\n", c.LatitudeV, c.LongitudeV, c.City)
	return ls.Box(80)
}
開發者ID:radhikapc,項目名稱:open311_gateway,代碼行數:8,代碼來源:services.go

示例4: String

// String returns a formatted representation of Adapters.
func (adps Adapters) String() string {
	ls := new(common.LogString)
	ls.AddS("Adapters\n")
	for _, v := range adps.Adapters {
		ls.AddS(v.String())
	}
	ls.AddS("\n-------Areas---------------\n")
	for _, v := range adps.Areas {
		// ls.AddS("   %5s %-7s  %-25s  [%s]\n", k, fmt.Sprintf("(%s)", v.ID), v.Name, fmt.Sprintf("\"%s\"", strings.Join(v.Aliases, "\", \"")))
		ls.AddF("%s\n", v)
	}
	ls.AddS("\n-------AreaAlias-----------\n")
	for k, v := range adps.areaAlias {
		ls.AddF("   %-20s  %s\n", k, v.ID)
	}
	ls.AddS("\n-------AreaAdapters--------\n")
	for k, v := range adps.areaAdapters {
		var s []string
		for _, a := range v {
			s = append(s, a.ID)
		}
		ls.AddF("   %-5s  %s\n", k, strings.Join(s, ", "))
	}
	return ls.Box(90)
}
開發者ID:radhikapc,項目名稱:open311_gateway,代碼行數:26,代碼來源:data.go

示例5: String

// Displays the contents of the Spec_Type custom type.
func (c NCreateResponse) String() string {
	ls := new(common.LogString)
	ls.AddS("Report - Resp\n")
	ls.AddF("Message: %s\n", c.Message)
	ls.AddF("ID: %v  AuthorID: %v\n", c.ID, c.AuthorID)
	return ls.Box(80)
}
開發者ID:radhikapc,項目名稱:open311_gateway,代碼行數:8,代碼來源:structs.go

示例6: String

// Displays the contents of the Spec_Type custom type.
func (sd ServicesData) String() string {
	ls := new(common.LogString)
	ls.AddS("ServicesData\n")
	for k, v := range sd.list {
		ls.AddF("<<<<<City: %s >>>>>\ns", k, v)
	}
	return ls.Box(90)
}
開發者ID:radhikapc,項目名稱:open311_gateway,代碼行數:9,代碼來源:services_wip.go

示例7: String

// Displays the contents of the Spec_Type custom type.
func (r CSSearchDIDReq) String() string {
	ls := new(common.LogString)
	ls.AddS("City Sourced - Search\n")
	ls.AddF("Device - type %s  ID: %s\n", r.DeviceType, r.DeviceID)
	ls.AddF("MaxResults: %v  IncludeDetails: %v\n", r.MaxResults, r.IncludeDetails)
	ls.AddF("Date Range - start: %v  end: %v\n", r.DateRangeStart, r.DateRangeEnd)
	return ls.Box(80)
}
開發者ID:radhikapc,項目名稱:open311_gateway,代碼行數:9,代碼來源:search.go

示例8: String

// Displays the contents of the Spec_Type custom type.
func (r ServicesResp) String() string {
	ls := new(common.LogString)
	ls.AddS("Services Response\n")
	ls.AddF("Message: %v\n", r.Message)
	for k, v := range r.Services {
		ls.AddF("%-18s %-30s [%s]\n", k, v.Name, strings.Join(v.Categories, ", "))
	}

	return ls.Box(80)
}
開發者ID:radhikapc,項目名稱:open311_gateway,代碼行數:11,代碼來源:services.go

示例9: String

func (r RPCCall) String() string {
	ls := new(common.LogString)
	ls.AddS("RPC Call\n")
	ls.AddF("Service: %s\n", r.service)
	ls.AddF("Request: (%p)  results chan: (%p)\n", &r.request, r.results)
	ls.AddF("%s\n", r.request)
	ls2 := new(common.LogString)
	ls2.AddS("Adapters\n")
	ls2.AddF("         Name/Type/Address                 Sent  Repl     Response\n")
	for k, v := range r.adpList {
		ls2.AddF("  %4s: %s\n", k, v)
	}
	ls.AddF("%s", ls2.Box(80))
	ls.AddF("Processes: %d\n", r.processes)
	ls.AddF("Process interface: (%p)\n", r.process)
	if len(r.errs) == 0 {
		ls.AddS("Error: NONE!\n")
	} else {
		ls.AddS("Errors\n")
		for _, e := range r.errs {
			ls.AddF("\t%s\n", e.Error())
		}
	}
	return ls.Box(90)
}
開發者ID:radhikapc,項目名稱:open311_gateway,代碼行數:25,代碼來源:rpc.go

示例10: String

// Displays the contents of the Spec_Type custom type.
func (c SearchReq) String() string {
	ls := new(common.LogString)
	ls.AddS("Search\n")
	ls.AddF("Bkend: %s\n", c.bkend)
	ls.AddF("Device ID: %s\n", c.DeviceID)
	ls.AddF("Location\n")
	if math.Abs(c.LatitudeV) > 1 {
		ls.AddF("   lat: %v  lon: %v\n", c.LatitudeV, c.LongitudeV)
	}
	if len(c.City) > 1 {
		ls.AddF("   \n", c.Address)
		ls.AddF("   %s, %s   %s\n", c.City, c.State, c.Zip)
	}
	return ls.Box(80)
}
開發者ID:radhikapc,項目名稱:open311_gateway,代碼行數:16,代碼來源:search.go


注:本文中的Gateway311/engine/common.LogString.AddS方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。