aboutsummaryrefslogtreecommitdiff
path: root/coremain/run.go
diff options
context:
space:
mode:
Diffstat (limited to 'coremain/run.go')
-rw-r--r--coremain/run.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/coremain/run.go b/coremain/run.go
index 71f968c98..b0d83b695 100644
--- a/coremain/run.go
+++ b/coremain/run.go
@@ -156,11 +156,15 @@ func defaultLoader(serverType string) (caddy.Input, error) {
}
// logVersion logs the version that is starting.
-func logVersion() { log.Print("[INFO] " + versionString()) }
+func logVersion() {
+ log.Print("[INFO] " + versionString())
+ log.Print("[INFO] " + releaseString())
+}
// showVersion prints the version that is starting.
func showVersion() {
fmt.Print(versionString())
+ fmt.Print(releaseString())
if devBuild && gitShortStat != "" {
fmt.Printf("%s\n%s\n", gitShortStat, gitFilesModified)
}
@@ -168,7 +172,15 @@ func showVersion() {
// versionString returns the CoreDNS version as a string.
func versionString() string {
- return fmt.Sprintf("%s-%s\n%s/%s, %s, %s\n", caddy.AppName, caddy.AppVersion, runtime.GOOS, runtime.GOARCH, runtime.Version(), gitCommit)
+ return fmt.Sprintf("%s-%s\n", caddy.AppName, caddy.AppVersion)
+}
+
+// releaseString returns the release information related to CoreDNS version:
+// <OS>/<ARCH>, <go version>, <commit>
+// e.g.,
+// linux/amd64, go1.8.3, a6d2d7b5
+func releaseString() string {
+ return fmt.Sprintf("%s/%s, %s, %s\n", runtime.GOOS, runtime.GOARCH, runtime.Version(), gitCommit)
}
// setVersion figures out the version information