added service code

alpha v1.0.72
alex 2023-03-04 08:37:04 +01:00
parent cc0ab4e553
commit 3f47ddd4ba
1 changed files with 4 additions and 4 deletions

View File

@ -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