add support for __cdist_debug={0,1,2}
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								74418c77e0
							
						
					
				
			
			
				commit
				
					
						c3bf34bf3d
					
				
			
		
					 2 changed files with 11 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -21,8 +21,16 @@
 | 
			
		|||
 | 
			
		||||
__cdist_version="1.8.0"
 | 
			
		||||
 | 
			
		||||
# Enable debugging
 | 
			
		||||
[ "$__cdist_debug" ] && set -x
 | 
			
		||||
#
 | 
			
		||||
# Enable debugging:
 | 
			
		||||
#
 | 
			
		||||
# __cdist_debug unset -> no debug
 | 
			
		||||
# __cdist_debug = 1 -> debug via __cdist_echo
 | 
			
		||||
# __cdist_debug = 2 -> debug via set -x
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
: ${__cdist_debug:=0}
 | 
			
		||||
[ "$__cdist_debug" = 2 ] && set -x
 | 
			
		||||
 | 
			
		||||
# Fail if something bogus is going on
 | 
			
		||||
set -u
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -35,11 +35,9 @@ __cdist_echo()
 | 
			
		|||
 | 
			
		||||
   case "$__cdist_echo_type" in
 | 
			
		||||
      debug)
 | 
			
		||||
         set +u
 | 
			
		||||
         if [ "$__cdist_debug" ]; then
 | 
			
		||||
         if [ "$__cdist_debug" = 1 ]; then
 | 
			
		||||
            echo $__cdist_echo_prefix "Debug: $@"
 | 
			
		||||
         fi
 | 
			
		||||
         set -u
 | 
			
		||||
      ;;
 | 
			
		||||
      info)
 | 
			
		||||
         echo $__cdist_echo_prefix "$@"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue