Skip to content

Commit

Permalink
Merge pull request #229 from fisuda/issue/228_print_version_revision
Browse files Browse the repository at this point in the history
Fix #228 that no version and revision are printed when error level is higher than info
  • Loading branch information
fisuda authored Jan 29, 2022
2 parents 27640aa + 87f2652 commit 8021c11
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NGSI Go v0.10.0-next

- Fix: Fix issue #228 that no version and revision are printed when error level is higher than info (#229)
- Update: Update golang to 1.17.6 (#227)
- Hardening: Support version command for Orion-LD (#226)
- Update: Update Orion-LD to 1.0.1 (#225)
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/1000_common/1001_stderr.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
ngsi --stderr info version --host unknown

```1
(git_hash:)
REGEX(.*)
Run001 error host: unknown
ngsiRun005 error host: unknown
newClient001 error host: unknown
Expand Down
3 changes: 3 additions & 0 deletions internal/ngsimain/ngsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ func Run(args []string, stdin io.Reader, stdout, stderr io.Writer) int {
bufStdout := bufio.NewWriter(stdout)
ngsi.InitLog(bufStdin, bufStdout, stderr)

ngsicli.Version = Version
ngsicli.Revision = Revision

Version = fmt.Sprintf("%s (git_hash:%s)", Version, Revision)

app := NewNgsiApp()
Expand Down

0 comments on commit 8021c11

Please sign in to comment.