Just get rid of this whole debug statement and ```eventNumber``` and then this will be thread-safe. Debug message are never seen without specially recompiling the code anyway. Plus, you could always use the Tracer Service to watch when a module is being run.