debug.h

ldmud-3.2.9/mud/lp-245/obj/debug.h · 739 B

From the archive ldmud-329.tar.gz

Download the archive   « Back to the archive contents

/* --------- debug.h ---------------------
 created by Tech the toolmaker also know
 as Anders Ripa (ripa@cd.chalmers.se)
--------------------------------------------*/

int is_debug;

id();
short();

/*
generic debug support for any object

typical uses are:

	if(is_debug) {
		write("in routine...\n");
	}
or
	if(is_debug) {
		tell_object(ob, "in routine...\n");
	}
*/

/* do add_action("debug_toggle", "debug"); */

debug_toggle(str) {
	if(!str || !id(str)) return 0;

	is_debug += 1;
	if(is_debug > 1) is_debug = 0;
	if(is_debug) {
		write("Debug is enabled for " + short() + "\n");
	} else {
		write("Debug is disabled for " + short() + "\n");
	}
	return 1;
}

query_debug() { return is_debug; }

set_debug(arg) { is_debug = arg; }

Site Stats

Snippets: 1791
Codebases: 571