Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print version on start #319

Merged
merged 2 commits into from
Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ _testmain.go
*.prof

.idea/
# used by intellij IDEA for project structures
*.iml
bin
src/github.com/

Expand Down
2 changes: 1 addition & 1 deletion cmd/acra-connector/acra-connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ type Config struct {
}

func main() {
log.Infof("Starting service %v [pid=%v]", ServiceName, os.Getpid())
log.WithField("version", utils.VERSION).Infof("Starting service %v [pid=%v]", ServiceName, os.Getpid())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... Why add version as a field but keep service name and PID just a part of the log string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm... I don't know what to say) legacy version vs new version)) All our components log at startup like Starting service BLABLA [pid=123] and only 3 (server/connector/translator) works as a daemon and good to log version for them. So used field to log instead raw string format


loggingFormat := flag.String("logging_format", "plaintext", "Logging format: plaintext, json or CEF")
keysDir := flag.String("keys_dir", keystore.DefaultKeyDirShort, "Folder from which will be loaded keys")
Expand Down
2 changes: 1 addition & 1 deletion cmd/acra-server/acra-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var ErrWaitTimeout = errors.New("timeout")

func main() {
loggingFormat := flag.String("logging_format", "plaintext", "Logging format: plaintext, json or CEF")
log.Infof("Starting service %v [pid=%v]", ServiceName, os.Getpid())
log.WithField("version", utils.VERSION).Infof("Starting service %v [pid=%v]", ServiceName, os.Getpid())

dbHost := flag.String("db_host", "", "Host to db")
dbPort := flag.Int("db_port", 5432, "Port to db")
Expand Down
2 changes: 1 addition & 1 deletion cmd/acra-translator/acra-translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var DefaultConfigPath = utils.GetConfigPathByName(ServiceName)
func main() {
config := NewConfig()
loggingFormat := flag.String("logging_format", "plaintext", "Logging format: plaintext, json or CEF")
log.Infof("Starting service %v [pid=%v]", ServiceName, os.Getpid())
log.WithField("version", utils.VERSION).Infof("Starting service %v [pid=%v]", ServiceName, os.Getpid())

incomingConnectionHTTPString := flag.String("incoming_connection_http_string", "", "Connection string for HTTP transport like http://0.0.0.0:9595")
incomingConnectionGRPCString := flag.String("incoming_connection_grpc_string", "", "Default option: connection string for gRPC transport like grpc://0.0.0.0:9696")
Expand Down
2 changes: 1 addition & 1 deletion utils/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ limitations under the License.
package utils

// VERSION is current Acra suite version
var VERSION = "0.84.0" // change on current during build
var VERSION = "0.84.2" // change on current during build