public static function maskErrors($mask)
    {
        if (!is_int($mask)) {
            throw new \InvalidArgumentException('Invalid input parameters.');
        }

        $currentEnabled = error_reporting();
        self::$logLevelStack[] = array($currentEnabled, self::$logMask);

        $currentEnabled &= ~$mask;
        error_reporting($currentEnabled);
        self::$logMask |= $mask;
    }