3 ############################################################
5 # author: devenkong(18151155@qq.com)
7 ############################################################
8 # Copyright (C) 2022- Free Software Foundation, Inc.
9 # This configure script is free software; the Free Software
10 # Foundation gives unlimited permission to copy, distribute
12 ############################################################
14 # use dbgout.shlib for debuging.
15 ############################################################
26 ##############################
27 # section: shlib include
28 ##############################
34 ##############################
35 # section: public comment info
36 ##############################
41 ##############################
42 # section: variable define
43 ##############################
45 longstr="adhdhjdjfjfjdjdjd
52 fkkforoeoeidjchshhsejj
56 ##############################
57 # section: private function
58 ##############################
63 # here is the example for stub debug
64 # use stub string to seperate application string info,
65 # if some of the code running error, it shows error code where it
69 dbgout "xxxxxxxxxxxx step1 xxxxxxxxxxxx\n"
72 dbgout "xxxxxxxxxxxx step2 xxxxxxxxxxxx\n"
75 dbgout "xxxxxxxxxxxx step3 xxxxxxxxxxxx\n"
78 dbgout "xxxxxxxxxxxx step4 xxxxxxxxxxxx\n"
81 dbgout "xxxxxxxxxxxx step5 xxxxxxxxxxxx\n"
84 dbgout "xxxxxxxxxxxx step6 xxxxxxxxxxxx\n"
90 # using stub to locate in src code
91 # it can be used for branch structure code.
97 echo application string output.
100 # display invoke stack to get the code location.
107 ##############################
108 # section: public function
109 ##############################
118 echo "func-paramter:"
120 init_dbglogout 2 shlibopt 20000
122 info "this example shows how to use debug infomation output function in sub-process of while loop."
124 echo xxxxxxxxxxxxxxxxxxxxxxxxx
126 echo testvar=$testvar
129 # use dbgoutvar to display long string by var name.
134 # display data as hex string.
136 echo dbgout_hex | dbgout_hex
141 [[ $cnt == 5 ]] && break
146 # output string on debug channel
151 # debug pause as a single step
155 info testvar=$testvar
157 echo "echo string in logfile."
158 dbgout "output debug string here.\n"
159 info "output info string on tty console."
160 done < <(cat data.txt) > output.txt
162 echo at last, cnt=$cnt
166 echo xxxxxxxxxxxxxxxxxxxxxxxxx
172 ##############################
174 ##############################