DebugOfTheRoad / elmah

Automatically exported from code.google.com/p/elmah
Apache License 2.0
0 stars 0 forks source link

Easy out of the box signal "logger" for elmah #267

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Although the error signal is easy enough, but I want something much simpler and 
cleaner, therefore I created this static class for my project, see if it is 
useful to put in to the .dll for some simple logging requirement. I was 
creating this for some logging and testing in production environment where VS 
debugger could not be applied.

-----------------------

namespace Elmah
{
    public static class SimpleLogger
    {
        public static void log(string errorMsg)
        {
            ErrorSignal.FromCurrentContext().Raise(new ElmahInfoLog(errorMsg));
        }
    }

    public class ElmahInfoLog : NotSupportedException
    {
        public ElmahInfoLog(string message) : base(message) { }
    }
}

---------------------

usage : 

Elmah.SimpleLogger("this is a log message");

Original issue reported on code.google.com by data...@gmail.com on 9 Jan 2012 at 4:27

GoogleCodeExporter commented 8 years ago
This issue has been migrated to:
https://github.com/elmah/Elmah/issues/267
The conversation continues there.
DO NOT post any further comments to the issue tracker on Google Code as it is 
shutting down.
You can also just subscribe to the issue on GitHub to receive notifications of 
any further development.

Original comment by azizatif on 25 Aug 2015 at 8:22