hyperledger-archives / iroha

Iroha - A simple, decentralized ledger
http://iroha.tech
Apache License 2.0
988 stars 298 forks source link

Provide git version info #2127

Closed MBoldyrev closed 5 years ago

MBoldyrev commented 5 years ago

Description of the Change

Make iroha version available through --version argument and in log pattern.

The log pattern can now include git commit hash formatted like %h or %6h, where the first will be substituted with the whole hash, and the second with the first 6 chars.

Benefits

When someone sends error logs, exact source version is available (as by default).

Possible Drawbacks

Longer log lines. Requires Git to work.

MBoldyrev commented 5 years ago

In a discussion on commit hash inclusion to log lines format we decided it is an excessive info, so I reverted that change and added a single log line containing the version to be printed during startup.

MBoldyrev commented 5 years ago

That is how it looks compiled on my machine:

[2019-02-28 09:32:51.729015315] [I] [Init]: Irohad version: v0.75-4927-g50675ce8d
MBoldyrev commented 5 years ago

As the logger formatting with git hash was considered unneeded, I rebased the branch from the new logger to develop.