added check for g_logger in log(..) method