Example #1
0
        private void Info(string filename, string methodname, string message)
        {
            var ex = new InfoException(
                $"[{filename}:{methodname}] => {message}"
                )
            {
                Source = string.Format($"{filename}:{methodname}")
            };

            Log(ex);
        }
    public static std_core._exception_info ExnInfo(Exception exn)
    {
        InfoException eexn = exn as InfoException;

        if (eexn != null)
        {
            return(eexn.info);
        }
        else
        {
            return(new std_core.Error_());
        }
    }
        public string SayHello([ActivityTrigger] string phone)         // Logger now comes from DI
        {
            CallCount += 1;
            _log.Enter(LogEventLevel.Information, message: $"Sending message count:{CallCount}");
            if (CallCount % 3 != 0)
            {
                var exception = new InfoException(CallCount, "Random failure");
                _log.Exception(LogEventLevel.Error, exception: exception, message: "Fired random failure");
                throw exception;                 // just to demonstrate retry functionality
            }


            _log.Exit(LogEventLevel.Information, message: $"Sending message to {phone}.");
            return($"Sent message to {phone}!");
        }
Example #4
0
    public static __std_core._exception_info ExnInfo(Exception exn)
    {
        InfoException eexn = exn as InfoException;

        if (eexn != null)
        {
            return(eexn.info);
        }
        InfoFinalizeException fexn = exn as InfoFinalizeException;

        if (fexn != null)
        {
            return(fexn.info);
        }
        return(new __std_core.Error_());
    }