Commit 06740201 by Eric Coissac

Add DEBUG level logs on stack operations

parent 14997f20
...@@ -33,6 +33,7 @@ logdebug "Load stacks package" ...@@ -33,6 +33,7 @@ logdebug "Load stacks package"
function newstack() { function newstack() {
logdebug "New stack ${1} created"
eval declare -a "${1}" eval declare -a "${1}"
} }
...@@ -41,6 +42,7 @@ function stacksize() { ...@@ -41,6 +42,7 @@ function stacksize() {
} }
function pushvalue() { function pushvalue() {
logdebug "New value pushed on stack ${1}"
p="${1}[$(stacksize ${1})]=\"${2}\"" p="${1}[$(stacksize ${1})]=\"${2}\""
eval "$p" eval "$p"
} }
...@@ -48,6 +50,7 @@ function pushvalue() { ...@@ -48,6 +50,7 @@ function pushvalue() {
function popvalue() { function popvalue() {
local __popvalue_STACK="${1}" local __popvalue_STACK="${1}"
shift shift
logdebug "New value poped from stack ${__popvalue_STACK}"
if [[ ! -z "${1}" ]]; then if [[ ! -z "${1}" ]]; then
local __popvalue_COMMAND="${1}=" local __popvalue_COMMAND="${1}="
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment