Skip to content

Commit

Permalink
Merge pull request Kong#1607 from Mashape/fix/log-version-info
Browse files Browse the repository at this point in the history
fix(cli) include version information in debug and verbose logging
  • Loading branch information
thibaultcha authored Sep 8, 2016
2 parents 7a9e7b2 + 86af6d9 commit d223adb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kong/cmd/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local pl_app = require "pl.lapp"
local log = require "kong.cmd.utils.log"
local meta = require "kong.meta"

local options = [[
--v verbose
Expand Down Expand Up @@ -78,6 +79,11 @@ return function(args)
args.trace = true
end

log.verbose("Kong: %s", meta._VERSION)
log.debug("ngx_lua: %s", ngx.config.ngx_lua_version)
log.debug("nginx: %s", ngx.config.nginx_version)
log.debug("Lua: %s", jit and jit.version or _VERSION)

xpcall(function() cmd_exec(args) end, function(err)
if not args.trace then
err = err:match "^.-:.-:.(.*)$"
Expand Down

0 comments on commit d223adb

Please sign in to comment.