mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
chg: better debugging functions.
This commit is contained in:
parent
73a5e3b23d
commit
c4b73c8737
2 changed files with 31 additions and 12 deletions
|
@ -15,19 +15,29 @@ Arguments:
|
||||||
-o <filename> Specifies the output file. If omitted, <uid>.eml is used.
|
-o <filename> Specifies the output file. If omitted, <uid>.eml is used.
|
||||||
|
|
||||||
]]
|
]]
|
||||||
|
local DEBUG = false
|
||||||
|
|
||||||
---
|
---
|
||||||
-- A debug printout-function
|
-- A debug printout-function
|
||||||
function dbg(args)
|
local function dbg(args)
|
||||||
if DEBUG then
|
if not DEBUG then return end
|
||||||
print("###", args)
|
|
||||||
|
if type(args) == 'table' then
|
||||||
|
local i = 1
|
||||||
|
while result[i] do
|
||||||
|
dbg(result[i])
|
||||||
|
i = i+1
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print('###', args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
---
|
---
|
||||||
-- This is only meant to be used when errors occur
|
-- This is only meant to be used when errors occur
|
||||||
function oops(err)
|
local function oops(err)
|
||||||
print("ERROR: ",err)
|
print('ERROR: ',err)
|
||||||
|
return nil,err
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Usage help
|
-- Usage help
|
||||||
function help()
|
function help()
|
||||||
|
|
|
@ -16,22 +16,31 @@ Arguments:
|
||||||
-o <filename> Specifies the output file. If omitted, <uid>.eml is used.
|
-o <filename> Specifies the output file. If omitted, <uid>.eml is used.
|
||||||
|
|
||||||
]]
|
]]
|
||||||
|
local DEBUG = false
|
||||||
-------------------------------
|
-------------------------------
|
||||||
-- Some utilities
|
-- Some utilities
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
||||||
---
|
---
|
||||||
-- A debug printout-function
|
-- A debug printout-function
|
||||||
function dbg(args)
|
local function dbg(args)
|
||||||
if DEBUG then
|
if not DEBUG then return end
|
||||||
print("###", args)
|
|
||||||
|
if type(args) == 'table' then
|
||||||
|
local i = 1
|
||||||
|
while result[i] do
|
||||||
|
dbg(result[i])
|
||||||
|
i = i+1
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print('###', args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
---
|
---
|
||||||
-- This is only meant to be used when errors occur
|
-- This is only meant to be used when errors occur
|
||||||
function oops(err)
|
local function oops(err)
|
||||||
print("ERROR: ",err)
|
print('ERROR: ',err)
|
||||||
|
return nil,err
|
||||||
end
|
end
|
||||||
---
|
---
|
||||||
-- Usage help
|
-- Usage help
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue