Here's my approach.
I use divide my systems into folders, and subsystems into .dm files. I then define at the top of each DM a variable like var/DEBUG_FLOORS which I then disperse throughout that code file with world.log outputs, to let me test the system to make sure the right calls are happening at the right time.
var/DEBUG_BUILDING = FALSE
/*
...
*/
building
var contents[]
New()
contents = new
proc/Add(atom/movable/am)
if(DEBUG_FLOORS) world.log << "DEBUG BUILDING: 3a; building.Add([am])"
am.building = src
contents.Add(am)
proc/Remove(atom/movable/am)
if(DEBUG_FLOORS) world.log << "DEBUG BUILDING: 3b; building.Remove([am])"
contents.Remove(am)
am.building = null
proc/Merge(building/b)
if(DEBUG_FLOORS) world.log << "DEBUG BUILDING: 3c; building.Merge([b])"
for(var/atom/movable/a in b.contents)
b.Remove(a)
Add(a)
b.contents = contents
del b
Aside from that, unless I'm releasing something to be downloaded or hosted from a hub, I always have debug defined.
What does everyone else do to make debugging and testing easier for themselves, or what have they seen other do? I'd love to hear it.
This works for any preprocessor: