#!/bin/bash
#########################################################
# 							#
# This is BashStyle-NG  				#
#							#
# Licensed under GNU GENERAL PUBLIC LICENSE v3    	#
#							#
# Copyright 2007 - 2010 Christopher Bratusek		#
#							#
#########################################################

BSNG_LOGFILE=$(get_key debug_log)

debug=$(get_key debug)

verbose=$(get_key debug_verbose)

dbg_msg ()
{

	if [[ $debug == true ]] ; then
		if [[ $verbose == true ]]; then
			echo -e "$@" | tee -a $BSNG_LOGFILE
		else	echo -e "$@" >> $BSNG_LOGFILE
		fi
	fi

}

dbg_view ()
{

	vim $BSNG_LOGFILE || nano $BSNG_LOGFILE

}

dbg_verbosity ()
{

	if [[ $1 == "1" ]]; then
		set_key bool /apps/bashstyle/debug_verbose true
	elif [[ $1 == "0" ]]; then
		set_key bool /apps/bashstyle/debug_verbose false
	fi

}
