You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Zev (JIRA)" <ji...@apache.org> on 2010/12/27 03:22:45 UTC

[jira] Created: (LOG4NET-281) Insufficient Granularity on Log methods in ILog

Insufficient Granularity on Log methods in ILog
-----------------------------------------------

                 Key: LOG4NET-281
                 URL: https://issues.apache.org/jira/browse/LOG4NET-281
             Project: Log4net
          Issue Type: New Feature
          Components: Core
    Affects Versions: 1.2.10
         Environment: All Environments
            Reporter: Zev
             Fix For: 1.2.11


updated code:

ILog.cs

        //start new
        void Emergency(object message);
        void Emergency(object message, Exception e);
        void Alert(object message);
        void Alert(object message, Exception e);
        void Critical(object message);
        void Critical(object message, Exception e);
        void Notice(object message);
        void Notice(object message, Exception e);
        //end new


LogImpl.cs (in ReloadLevels)
            //start new
            m_levelEmergency = levelMap.LookupWithDefault(Level.Emergency);
            m_levelAlert = levelMap.LookupWithDefault(Level.Alert);
            m_levelCritical = levelMap.LookupWithDefault(Level.Critical);
            m_levelNotice = levelMap.LookupWithDefault(Level.Notice);
            //end new

methods:
        //start new
        virtual public void Emergency(object message)
        {
            Logger.Log(ThisDeclaringType, m_levelEmergency, message, null);
        }

        virtual public void Emergency(object message, Exception exception)
        {
            Logger.Log(ThisDeclaringType, m_levelEmergency, message, exception);
        }
        virtual public void Alert(object message)
        {
            Logger.Log(ThisDeclaringType, m_levelAlert, message, null);
        }

        virtual public void Alert(object message, Exception exception)
        {
            Logger.Log(ThisDeclaringType, m_levelAlert, message, exception);
        }
        virtual public void Critical(object message)
        {
            Logger.Log(ThisDeclaringType, m_levelCritical, message, null);
        }

        virtual public void Critical(object message, Exception exception)
        {
            Logger.Log(ThisDeclaringType, m_levelCritical, message, exception);
        }
        virtual public void Notice(object message)
        {
            Logger.Log(ThisDeclaringType, m_levelNotice, message, null);
        }

        virtual public void Notice(object message, Exception exception)
        {
            Logger.Log(ThisDeclaringType, m_levelNotice, message, exception);
        }
        //end new

private fields:
        //start new
        private Level m_levelEmergency;
        private Level m_levelAlert;
        private Level m_levelCritical;
        private Level m_levelNotice;
        //end new


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] [Updated] (LOG4NET-281) Insufficient Granularity on Log methods in ILog

Posted by "Stefan Bodewig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4NET-281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Bodewig updated LOG4NET-281:
-----------------------------------

    Fix Version/s:     (was: 1.2.11)
                   2.0

Putting it back to a release where we are willing to break backwards compatibility.

You could always bypass ILog's convenience layer and use the ILogger instance avaliable via the Logger property directly.

> Insufficient Granularity on Log methods in ILog
> -----------------------------------------------
>
>                 Key: LOG4NET-281
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-281
>             Project: Log4net
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 1.2.10
>         Environment: All Environments
>            Reporter: Zev
>             Fix For: 2.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> The driver for this change is that we are unable to log certain event types from the ILog object. While we can use the Logger object, it is easier to have them here.
> updated code:
> ILog.cs
>         //start new
>         void Emergency(object message);
>         void Emergency(object message, Exception e);
>         void Alert(object message);
>         void Alert(object message, Exception e);
>         void Critical(object message);
>         void Critical(object message, Exception e);
>         void Notice(object message);
>         void Notice(object message, Exception e);
>         //end new
> LogImpl.cs (in ReloadLevels)
>             //start new
>             m_levelEmergency = levelMap.LookupWithDefault(Level.Emergency);
>             m_levelAlert = levelMap.LookupWithDefault(Level.Alert);
>             m_levelCritical = levelMap.LookupWithDefault(Level.Critical);
>             m_levelNotice = levelMap.LookupWithDefault(Level.Notice);
>             //end new
> methods:
>         //start new
>         virtual public void Emergency(object message)
>         {
>             Logger.Log(ThisDeclaringType, m_levelEmergency, message, null);
>         }
>         virtual public void Emergency(object message, Exception exception)
>         {
>             Logger.Log(ThisDeclaringType, m_levelEmergency, message, exception);
>         }
>         virtual public void Alert(object message)
>         {
>             Logger.Log(ThisDeclaringType, m_levelAlert, message, null);
>         }
>         virtual public void Alert(object message, Exception exception)
>         {
>             Logger.Log(ThisDeclaringType, m_levelAlert, message, exception);
>         }
>         virtual public void Critical(object message)
>         {
>             Logger.Log(ThisDeclaringType, m_levelCritical, message, null);
>         }
>         virtual public void Critical(object message, Exception exception)
>         {
>             Logger.Log(ThisDeclaringType, m_levelCritical, message, exception);
>         }
>         virtual public void Notice(object message)
>         {
>             Logger.Log(ThisDeclaringType, m_levelNotice, message, null);
>         }
>         virtual public void Notice(object message, Exception exception)
>         {
>             Logger.Log(ThisDeclaringType, m_levelNotice, message, exception);
>         }
>         //end new
> private fields:
>         //start new
>         private Level m_levelEmergency;
>         private Level m_levelAlert;
>         private Level m_levelCritical;
>         private Level m_levelNotice;
>         //end new

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (LOG4NET-281) Insufficient Granularity on Log methods in ILog

Posted by "Walden Leverich (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977310#action_12977310 ] 

Walden Leverich commented on LOG4NET-281:
-----------------------------------------

There have been many times I wish this was in there, I'd like some granularity on the low end too. However the problem is that changing this interface would be a breaking change, and adding these is something I don't think warrants a breaking change. Perhaps it's time for a ILog2, or ILogGranular interface which adds these? At least then it would be a non-breaking change.

> Insufficient Granularity on Log methods in ILog
> -----------------------------------------------
>
>                 Key: LOG4NET-281
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-281
>             Project: Log4net
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 1.2.10
>         Environment: All Environments
>            Reporter: Zev
>             Fix For: 1.2.11
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> The driver for this change is that we are unable to log certain event types from the ILog object. While we can use the Logger object, it is easier to have them here.
> updated code:
> ILog.cs
>         //start new
>         void Emergency(object message);
>         void Emergency(object message, Exception e);
>         void Alert(object message);
>         void Alert(object message, Exception e);
>         void Critical(object message);
>         void Critical(object message, Exception e);
>         void Notice(object message);
>         void Notice(object message, Exception e);
>         //end new
> LogImpl.cs (in ReloadLevels)
>             //start new
>             m_levelEmergency = levelMap.LookupWithDefault(Level.Emergency);
>             m_levelAlert = levelMap.LookupWithDefault(Level.Alert);
>             m_levelCritical = levelMap.LookupWithDefault(Level.Critical);
>             m_levelNotice = levelMap.LookupWithDefault(Level.Notice);
>             //end new
> methods:
>         //start new
>         virtual public void Emergency(object message)
>         {
>             Logger.Log(ThisDeclaringType, m_levelEmergency, message, null);
>         }
>         virtual public void Emergency(object message, Exception exception)
>         {
>             Logger.Log(ThisDeclaringType, m_levelEmergency, message, exception);
>         }
>         virtual public void Alert(object message)
>         {
>             Logger.Log(ThisDeclaringType, m_levelAlert, message, null);
>         }
>         virtual public void Alert(object message, Exception exception)
>         {
>             Logger.Log(ThisDeclaringType, m_levelAlert, message, exception);
>         }
>         virtual public void Critical(object message)
>         {
>             Logger.Log(ThisDeclaringType, m_levelCritical, message, null);
>         }
>         virtual public void Critical(object message, Exception exception)
>         {
>             Logger.Log(ThisDeclaringType, m_levelCritical, message, exception);
>         }
>         virtual public void Notice(object message)
>         {
>             Logger.Log(ThisDeclaringType, m_levelNotice, message, null);
>         }
>         virtual public void Notice(object message, Exception exception)
>         {
>             Logger.Log(ThisDeclaringType, m_levelNotice, message, exception);
>         }
>         //end new
> private fields:
>         //start new
>         private Level m_levelEmergency;
>         private Level m_levelAlert;
>         private Level m_levelCritical;
>         private Level m_levelNotice;
>         //end new

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LOG4NET-281) Insufficient Granularity on Log methods in ILog

Posted by "Zev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4NET-281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zev updated LOG4NET-281:
------------------------

    Description: 
The driver for this change is that we are unable to log certain event types from the ILog object. While we can use the Logger object, it is easier to have them here.

updated code:

ILog.cs

        //start new
        void Emergency(object message);
        void Emergency(object message, Exception e);
        void Alert(object message);
        void Alert(object message, Exception e);
        void Critical(object message);
        void Critical(object message, Exception e);
        void Notice(object message);
        void Notice(object message, Exception e);
        //end new


LogImpl.cs (in ReloadLevels)
            //start new
            m_levelEmergency = levelMap.LookupWithDefault(Level.Emergency);
            m_levelAlert = levelMap.LookupWithDefault(Level.Alert);
            m_levelCritical = levelMap.LookupWithDefault(Level.Critical);
            m_levelNotice = levelMap.LookupWithDefault(Level.Notice);
            //end new

methods:
        //start new
        virtual public void Emergency(object message)
        {
            Logger.Log(ThisDeclaringType, m_levelEmergency, message, null);
        }

        virtual public void Emergency(object message, Exception exception)
        {
            Logger.Log(ThisDeclaringType, m_levelEmergency, message, exception);
        }
        virtual public void Alert(object message)
        {
            Logger.Log(ThisDeclaringType, m_levelAlert, message, null);
        }

        virtual public void Alert(object message, Exception exception)
        {
            Logger.Log(ThisDeclaringType, m_levelAlert, message, exception);
        }
        virtual public void Critical(object message)
        {
            Logger.Log(ThisDeclaringType, m_levelCritical, message, null);
        }

        virtual public void Critical(object message, Exception exception)
        {
            Logger.Log(ThisDeclaringType, m_levelCritical, message, exception);
        }
        virtual public void Notice(object message)
        {
            Logger.Log(ThisDeclaringType, m_levelNotice, message, null);
        }

        virtual public void Notice(object message, Exception exception)
        {
            Logger.Log(ThisDeclaringType, m_levelNotice, message, exception);
        }
        //end new

private fields:
        //start new
        private Level m_levelEmergency;
        private Level m_levelAlert;
        private Level m_levelCritical;
        private Level m_levelNotice;
        //end new


  was:
updated code:

ILog.cs

        //start new
        void Emergency(object message);
        void Emergency(object message, Exception e);
        void Alert(object message);
        void Alert(object message, Exception e);
        void Critical(object message);
        void Critical(object message, Exception e);
        void Notice(object message);
        void Notice(object message, Exception e);
        //end new


LogImpl.cs (in ReloadLevels)
            //start new
            m_levelEmergency = levelMap.LookupWithDefault(Level.Emergency);
            m_levelAlert = levelMap.LookupWithDefault(Level.Alert);
            m_levelCritical = levelMap.LookupWithDefault(Level.Critical);
            m_levelNotice = levelMap.LookupWithDefault(Level.Notice);
            //end new

methods:
        //start new
        virtual public void Emergency(object message)
        {
            Logger.Log(ThisDeclaringType, m_levelEmergency, message, null);
        }

        virtual public void Emergency(object message, Exception exception)
        {
            Logger.Log(ThisDeclaringType, m_levelEmergency, message, exception);
        }
        virtual public void Alert(object message)
        {
            Logger.Log(ThisDeclaringType, m_levelAlert, message, null);
        }

        virtual public void Alert(object message, Exception exception)
        {
            Logger.Log(ThisDeclaringType, m_levelAlert, message, exception);
        }
        virtual public void Critical(object message)
        {
            Logger.Log(ThisDeclaringType, m_levelCritical, message, null);
        }

        virtual public void Critical(object message, Exception exception)
        {
            Logger.Log(ThisDeclaringType, m_levelCritical, message, exception);
        }
        virtual public void Notice(object message)
        {
            Logger.Log(ThisDeclaringType, m_levelNotice, message, null);
        }

        virtual public void Notice(object message, Exception exception)
        {
            Logger.Log(ThisDeclaringType, m_levelNotice, message, exception);
        }
        //end new

private fields:
        //start new
        private Level m_levelEmergency;
        private Level m_levelAlert;
        private Level m_levelCritical;
        private Level m_levelNotice;
        //end new



> Insufficient Granularity on Log methods in ILog
> -----------------------------------------------
>
>                 Key: LOG4NET-281
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-281
>             Project: Log4net
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 1.2.10
>         Environment: All Environments
>            Reporter: Zev
>             Fix For: 1.2.11
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> The driver for this change is that we are unable to log certain event types from the ILog object. While we can use the Logger object, it is easier to have them here.
> updated code:
> ILog.cs
>         //start new
>         void Emergency(object message);
>         void Emergency(object message, Exception e);
>         void Alert(object message);
>         void Alert(object message, Exception e);
>         void Critical(object message);
>         void Critical(object message, Exception e);
>         void Notice(object message);
>         void Notice(object message, Exception e);
>         //end new
> LogImpl.cs (in ReloadLevels)
>             //start new
>             m_levelEmergency = levelMap.LookupWithDefault(Level.Emergency);
>             m_levelAlert = levelMap.LookupWithDefault(Level.Alert);
>             m_levelCritical = levelMap.LookupWithDefault(Level.Critical);
>             m_levelNotice = levelMap.LookupWithDefault(Level.Notice);
>             //end new
> methods:
>         //start new
>         virtual public void Emergency(object message)
>         {
>             Logger.Log(ThisDeclaringType, m_levelEmergency, message, null);
>         }
>         virtual public void Emergency(object message, Exception exception)
>         {
>             Logger.Log(ThisDeclaringType, m_levelEmergency, message, exception);
>         }
>         virtual public void Alert(object message)
>         {
>             Logger.Log(ThisDeclaringType, m_levelAlert, message, null);
>         }
>         virtual public void Alert(object message, Exception exception)
>         {
>             Logger.Log(ThisDeclaringType, m_levelAlert, message, exception);
>         }
>         virtual public void Critical(object message)
>         {
>             Logger.Log(ThisDeclaringType, m_levelCritical, message, null);
>         }
>         virtual public void Critical(object message, Exception exception)
>         {
>             Logger.Log(ThisDeclaringType, m_levelCritical, message, exception);
>         }
>         virtual public void Notice(object message)
>         {
>             Logger.Log(ThisDeclaringType, m_levelNotice, message, null);
>         }
>         virtual public void Notice(object message, Exception exception)
>         {
>             Logger.Log(ThisDeclaringType, m_levelNotice, message, exception);
>         }
>         //end new
> private fields:
>         //start new
>         private Level m_levelEmergency;
>         private Level m_levelAlert;
>         private Level m_levelCritical;
>         private Level m_levelNotice;
>         //end new

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.