Пример #1
0
        public static void SetStatusCode(this ILogger logger, int statusCode)
        {
            if (logger == null)
            {
                return;
            }

            Logger kisslogger = KissLog.InternalHelpers.WrapInTryCatch(() => InternalHelpers.TryGetKissLogLogger(logger));

            if (kisslogger != null)
            {
                kisslogger.SetStatusCode(statusCode);
            }
        }
        public static void LogAsFile(this ILogger logger, string contents, string fileName = null)
        {
            if (logger == null)
            {
                return;
            }

            Logger kisslogger = KissLog.InternalHelpers.WrapInTryCatch(() => InternalHelpers.TryGetKissLogLogger(logger));

            if (kisslogger != null)
            {
                kisslogger.LogAsFile(contents, fileName);
            }
        }
Пример #3
0
        public static void LogResponseBody(this ILogger logger, bool value)
        {
            if (logger == null)
            {
                return;
            }

            Logger kisslogger = KissLog.InternalHelpers.WrapInTryCatch(() => InternalHelpers.TryGetKissLogLogger(logger));

            if (kisslogger != null)
            {
                kisslogger.LogResponseBody(value);
            }
        }
        public static void AddCustomProperty(this ILogger logger, string name, DateTime value)
        {
            if (logger == null)
            {
                return;
            }

            Logger kisslogger = KissLog.InternalHelpers.WrapInTryCatch(() => InternalHelpers.TryGetKissLogLogger(logger));

            if (kisslogger != null)
            {
                kisslogger.AddCustomProperty(name, value);
            }
        }
Пример #5
0
        public static bool AutoFlush(this ILogger logger)
        {
            if (logger == null)
            {
                return(false);
            }

            Logger kisslogger = KissLog.InternalHelpers.WrapInTryCatch(() => InternalHelpers.TryGetKissLogLogger(logger));

            if (kisslogger != null)
            {
                return(kisslogger.AutoFlush());
            }

            return(false);
        }