fixed a segfault crash in cs_log() and cs_log_debug()