Skip to content

Commit

Permalink
fix LuaHandler to support %.2f
Browse files Browse the repository at this point in the history
  • Loading branch information
zrong authored and zrong committed Feb 13, 2015
1 parent a1c20db commit df303b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/zrong/zr/log/LogHandler.lua
Expand Up @@ -32,9 +32,9 @@ function LogHandler:getString(level, fmt, args)
end
local argsnum = #args
if argsnum > 0 and _isfmt(fmt) then
local fmtnum = select(2, string.gsub(fmt, '%%%a', ''))
local fmtnum = select(2, string.gsub(fmt, '%%[%a%.]', ''))
if fmtnum ~= argsnum then
strlist[#strlist+1] = 'LogHandler ERROR -- Cannot get a nil value between arguments OR you give a bad amout of arguments.'
strlist[#strlist+1] = 'LogHandler WARNING -- Cannot get a nil value between arguments OR you give a bad amout of arguments.'
else
strlist[#strlist+1] = string.format(fmt, unpack(args))
end
Expand Down

0 comments on commit df303b6

Please sign in to comment.