omdl  v0.6.1
OpenSCAD Mechanical Design Library
Console

Console message logging. More...

+ Collaboration diagram for Console:

Files

file  console.scad
 Message logging functions.
 

Functions

function stack (b=0, t=0)
 Format the function call stack as a string. More...
 
module log_echo (m)
 Output message to console. More...
 
module log_debug (m)
 Output diagnostic message to console. More...
 
module log_info (m)
 Output information message to console. More...
 
module log_warn (m)
 Output warning message to console. More...
 
module log_error (m)
 Output error message to console. More...
 

Detailed Description

Console message logging.

Example

Result

ECHO: "console log message"
ECHO: "[ DEBUG ] root(); console log message"
ECHO: "[ INFO ] root(); console log message"
ECHO:
ECHO: "root()"
ECHO: "###################################"
ECHO: "# [ WARNING ] console log message #"
ECHO: "###################################"
ECHO:
ECHO: "root()"
ECHO: "###################################"
ECHO: "###################################"
ECHO: "## ##"
ECHO: "## [ ERROR ] console log message ##"
ECHO: "## ##"
ECHO: "###################################"
ECHO: "###################################"

Function Documentation

module log_debug ( )

Output diagnostic message to console.

Parameters
m<string> An output message.

Message is written if and only if $log_debug is true.

Definition at line 105 of file console.scad.

+ Here is the call graph for this function:

module log_echo ( )

Output message to console.

Parameters
m<string> An output message.

Definition at line 90 of file console.scad.

+ Here is the caller graph for this function:

module log_error ( )

Output error message to console.

Parameters
m<string> An output message.

Output an error message to the console. Ideally, rendering should halt and the script should exit. However, no suitable abort function exists. To alert of the critical error, the error message is also rendered graphically.

Definition at line 166 of file console.scad.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

module log_info ( )

Output information message to console.

Parameters
m<string> An output message.

Definition at line 122 of file console.scad.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

module log_warn ( )

Output warning message to console.

Parameters
m<string> An output message.

Definition at line 137 of file console.scad.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

function stack ( = 0,
= 0 
)

Format the function call stack as a string.

Parameters
b<integer> The stack index bottom offset. Return function names above this offset.
t<integer> The stack index top offset. Return function names below this offset.
Returns
<string> A string-formatted colon-separated list of functions names for the current function call stack.
Note
Returns undef when b is greater than the current number of function instances (ie: b > $parent_modules-1).
Returns the string "root()" when the function call stack is empty (ie: at the root of a script).

+ Here is the caller graph for this function: