Skip to content

Commit

Permalink
fix(cli) drop the --trace option as it provides little information.
Browse files Browse the repository at this point in the history
The former `trace` info is automatically added to verbose and debug level logging.
  • Loading branch information
Tieske committed Sep 8, 2016
1 parent 97d6ed4 commit 4e0d053
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kong/cmd/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ local log = require "kong.cmd.utils.log"
local options = [[
--v verbose
--vv debug
--trace with traceback
]]

local cmds_arr = {}
Expand Down Expand Up @@ -75,14 +74,13 @@ return function(args)
log.set_lvl(log.levels.verbose)
elseif args.vv then
log.set_lvl(log.levels.debug)
args.trace = true
end

xpcall(function() cmd_exec(args) end, function(err)
if not args.trace then
if not (args.v or args.vv) then
err = err:match "^.-:.-:.(.*)$"
io.stderr:write("Error: "..err.."\n")
io.stderr:write("\n Run with --trace to see traceback\n")
io.stderr:write("\n Run with --v (verbose) or --vv (debug) for more details\n")
else
local trace = debug.traceback(err, 2)
io.stderr:write("Error: \n")
Expand Down

0 comments on commit 4e0d053

Please sign in to comment.