function for determining if logger should log, return null from beginscope