ug4
debug_util.lua File Reference

Functions

function util CreateGridFuncDebugWriter (approxSpace)
 
function util GetLUAFileAndLine (backtraceLevel)
 
function ug_assert (condition, msg)
 
function ug_cond_warning (condition, text)
 
function ug_error (msg, otherMsg, backtraceSkipLevel)
 
function ug_warning (t)
 

Function Documentation

◆ CreateGridFuncDebugWriter()

function util CreateGridFuncDebugWriter ( approxSpace  )

Creates a grid function debug writer for the utilities. The function reads the settings from the table util.debug. If this is a boolean variable then no special settings are applied. If this variable is undefinde the no debug writer is created.

Parameters
approxSpacethe approximation space for the debug writer

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / debug_util.lua :98-128

◆ GetLUAFileAndLine()

function util GetLUAFileAndLine ( backtraceLevel  )
Parameters
backtraceLevelthe number of levels to go up for backtraceLevel = 0, it returns file and line of the calling function. for backtraceLevel = 1 the file and line of the caller of the calling function and so on.

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / debug_util.lua :82-91

function util.GetLUAFileAndLine (backtraceLevel)
local level = 2+backtraceLevel
local info = debug.getinfo(level, "Sl")
if not info then return "" end
if info.what == "C" then -- is a C function?
return "C function"
else
return string.format("[%s]:%d", info.short_src, info.currentline)
end
end
int local(bglp_vertex_descriptor p)
Definition: parallel_matrix.h:57

◆ ug_assert()

function ug_assert ( condition  ,
msg   
)

use it like ug_assert(numPreRefs <= numRefs, "It must be choosen: numPreRefs <= numRefs")

Parameters
conditionthe condition to assert
msg(optional) message to be printed if condition is not fulfilled

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / debug_util.lua :57-63

function ug_assert(condition, msg)
if condition then
return
else
ug_error(msg, "ASSERTION FAILED:")
end
end
function ug_assert(condition, msg)
function ug_error(msg, otherMsg, backtraceSkipLevel)

◆ ug_cond_warning()

function ug_cond_warning ( condition  ,
text   
)

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / debug_util.lua :70-74

function ug_cond_warning(condition, text)
if condition then
ug_warning(text)
end
end
function ug_cond_warning(condition, text)
function ug_warning(t)

◆ ug_error()

function ug_error ( msg  ,
otherMsg  ,
backtraceSkipLevel   
)

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / debug_util.lua :31-52

◆ ug_warning()

function ug_warning ( )

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / debug_util.lua :65-68

function ug_warning(t)
print(t)
err_log(t)
end
function table print(data, style)