parent
cc0ab4e553
commit
3f47ddd4ba
|
@ -14,7 +14,7 @@ import (
|
|||
|
||||
var (
|
||||
logsClient *Client
|
||||
gServiceCode string // An id to distinguish scaled servers of a service. For example, two socket servers. 1 server id = GJK , 2 server id = BAK
|
||||
gServiceCode string // An id to distinguish scaled servers of a service. For example, two socket servers. 1 server id = 552 , 2 server id = 123
|
||||
gServiceName uint8
|
||||
gServiceType uint8
|
||||
gRabbitMqLoggingEnabled bool
|
||||
|
@ -88,13 +88,13 @@ func InitLogger(debug bool, colorizedOutput bool, rabbitMqLogging bool, rabbitMq
|
|||
}
|
||||
}
|
||||
|
||||
const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
const numbers = "123456789"
|
||||
|
||||
func randomServiceCode() string {
|
||||
res := make([]byte, 3)
|
||||
|
||||
for i := 0; i < 3; i++ {
|
||||
res[i] = charset[rand.Intn(len(charset))]
|
||||
res[i] = numbers[rand.Intn(len(numbers))]
|
||||
}
|
||||
|
||||
return string(res)
|
||||
|
@ -211,7 +211,7 @@ func pushLogMessage(messageType uint8, logMsg string) {
|
|||
}
|
||||
|
||||
rabbitMqLogMessage := RabbitMqLogMessage{
|
||||
ServiceCode: gServiceCode, // could be ABC
|
||||
ServiceCode: gServiceCode, // could be 552
|
||||
MessageType: messageType, // could be debug, info
|
||||
ServiceName: gServiceName, // could be API
|
||||
ServiceType: gServiceType, // could be alpha
|
||||
|
|
Loading…
Reference in New Issue