Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-29 Thread Remko Popma
On Wednesday, January 29, 2014, Nick Williams nicho...@nicholaswilliams.net wrote: On Jan 28, 2014, at 5:43 PM, Remko Popma wrote: I would really like everyone's feedback on this. I have two questions: 1. Does this fulfill everyone's requirements? Another way of asking this is: would you

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-29 Thread Matt Sicker
Annotation processing is beyond over-engineered, yet it still lacks some of the neat features from runtime annotation processing. I've been meaning to look more into it as it might be useful for injecting Loggers using annotations. On 29 January 2014 07:46, Remko Popma remko.po...@gmail.com

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-29 Thread Paul Benedict
I would like to propose not doing anything on this subject until there is a request from the community. It's probably way too easy to over-engineer and devise solutions to problems that a small percentage (or zero?) of the users will need. I am all for ingenuity and passion, but after GA occurs

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-29 Thread Nick Williams
I agree. Nick On Jan 29, 2014, at 5:09 PM, Paul Benedict wrote: I would like to propose not doing anything on this subject until there is a request from the community. It's probably way too easy to over-engineer and devise solutions to problems that a small percentage (or zero?) of the

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-28 Thread Remko Popma
Date:01/27/2014 09:15 (GMT-05:00) To: Log4J Developers List Subject: Re: Using Custom Levels with a Custom/Wrapper Interface How about starting with something very simple at first? We provide a tool that generates the source code for a custom logger interface. To invoke the tool the user

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-28 Thread Remko Popma
I would really like everyone's feedback on this. I have two questions: 1. Does this fulfill everyone's requirements? Another way of asking this is: would you use this in your own projects? (If not, why not?) 2. What do you think of this approach? Obviously code generation has drawbacks. For one

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-28 Thread Gary Gregory
I plan on catching up on all this tomorrow night. Gary On Tue, Jan 28, 2014 at 6:43 PM, Remko Popma remko.po...@gmail.com wrote: I would really like everyone's feedback on this. I have two questions: 1. Does this fulfill everyone's requirements? Another way of asking this is: would you use

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-28 Thread Nick Williams
On Jan 28, 2014, at 5:43 PM, Remko Popma wrote: I would really like everyone's feedback on this. I have two questions: 1. Does this fulfill everyone's requirements? Another way of asking this is: would you use this in your own projects? (If not, why not?) Personally, no. I don't like the

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Remko Popma
How about starting with something very simple at first? We provide a tool that generates the source code for a custom logger interface. To invoke the tool the user passes it the fully qualified name of the interface, and a list of NAME=INTLEVEL custom log levels. The generated source code

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Paul Benedict
specific applications. For medical devices for example I could only have critical, warning, advisory. Original message From: Remko Popma Date:01/27/2014 09:15 (GMT-05:00) To: Log4J Developers List Subject: Re: Using Custom Levels with a Custom/Wrapper Interface How about

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Gary Gregory
-dev@logging.apache.org Subject: Re: Using Custom Levels with a Custom/Wrapper Interface How about starting with something very simple at first? We provide a tool that generates the source code for a custom logger interface. To invoke the tool the user passes it the fully qualified name

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Remko Popma
for domain specific applications. For medical devices for example I could only have critical, warning, advisory. Original message From: Remko Popma Date:01/27/2014 09:15 (GMT-05:00) To: Log4J Developers List Subject: Re: Using Custom Levels with a Custom/Wrapper Interface

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Paul Benedict
, warning, advisory. Original message From: Remko Popma Date:01/27/2014 09:15 (GMT-05:00) To: Log4J Developers List Subject: Re: Using Custom Levels with a Custom/Wrapper Interface How about starting with something very simple at first? We provide a tool that generates

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Gary Gregory
message From: Remko Popma Date:01/27/2014 09:15 (GMT-05:00) To: Log4J Developers List Subject: Re: Using Custom Levels with a Custom/Wrapper Interface How about starting with something very simple at first? We provide a tool that generates the source code for a custom logger

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Nick Williams
Date:01/27/2014 09:15 (GMT-05:00) To: Log4J Developers List Subject: Re: Using Custom Levels with a Custom/Wrapper Interface How about starting with something very simple at first? We provide a tool that generates the source code for a custom logger interface. To invoke the tool

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Ralph Goers
applications. For medical devices for example I could only have critical, warning, advisory. Original message From: Remko Popma Date:01/27/2014 09:15 (GMT-05:00) To: Log4J Developers List Subject: Re: Using Custom Levels with a Custom/Wrapper Interface How about

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Paul Benedict
(GMT-05:00) To: Log4J Developers List Subject: Re: Using Custom Levels with a Custom/Wrapper Interface How about starting with something very simple at first? We provide a tool that generates the source code for a custom logger interface. To invoke the tool the user passes it the fully

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Paul Benedict
On Jan 27, 2014, at 11:15 AM, Nick Williams nicho...@nicholaswilliams.net wrote: However, what I WOULD be okay with is creating a SimpleLogger interface for things like log(Level, ...), etc. and having Logger extend SimpleLogger to provide info(), warn(), and so on. This would be backwards

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Nick Williams
Okay, I see now. I got confused by what Gary said: That's brilliant! The Logger interface contains methods like log(Level, ...) and StandardLogger extends Logger to provide info(), warn() and so on. This let's me create a custom Logger (DEFCON example) AND an extension to StandardLogger

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Paul Benedict
I would like to see SimpleLogger be where custom interfaces are extended. Now you can't forget that if we provide a default implementation class, that will already implement Logger. So it's very easy to cast directly to Logger if necessary to access your standard methods. On Mon, Jan 27, 2014 at

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Gary Gregory
09:15 (GMT-05:00) To: Log4J Developers List Subject: Re: Using Custom Levels with a Custom/Wrapper Interface How about starting with something very simple at first? We provide a tool that generates the source code for a custom logger interface. To invoke the tool the user passes it the fully

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Remko Popma
Developers List Subject: Re: Using Custom Levels with a Custom/Wrapper Interface How about starting with something very simple at first? We provide a tool that generates the source code for a custom logger interface. To invoke the tool the user passes it the fully qualified name of the interface

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-27 Thread Remko Popma
. For medical devices for example I could only have critical, warning, advisory. Original message From: Remko Popma Date:01/27/2014 09:15 (GMT-05:00) To: Log4J Developers List Subject: Re: Using Custom Levels with a Custom/Wrapper Interface How about starting with something very

Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Nick Williams
Here's a split-off thread for discussing how we can make using custom levels easier. Some on the team have expressed a desire to make it even easier. Given hypothetical custom levels DIAG and NOTE, the following would be nice to have: logger.note(message); logger.diag(message); etc. We're to

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Scott Deboy
If there is a way to support this strictly through configuration that would be ideal. I'm trying to find a way to remove my request for additional built in levels but through configuration instead of adding them ourselves. Scott Scott On Jan 26, 2014 7:38 PM, Nick Williams

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Nick Williams
It would not be possible to do this strictly through configuration because the user needs a compiled interface to code against. Where is that compiled interface to come from? Nick On Jan 26, 2014, at 9:40 PM, Scott Deboy wrote: If there is a way to support this strictly through configuration

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Matt Sicker
The JPA criteria API manages to generate a Foo_ class for the entity class Foo, and that seems to work out fine. On 26 January 2014 21:45, Nick Williams nicho...@nicholaswilliams.netwrote: It would not be possible to do this strictly through configuration because the user needs a compiled

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Ralph Goers
I am going to have to echo what Nick said. If you can think of a way to make logger.log(SomeClass.SomeLevel, “hello world”); work without actually creating SomeClass then please share! Ralph On Jan 26, 2014, at 7:45 PM, Nick Williams nicho...@nicholaswilliams.net wrote: It would not be

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Remko Popma
I actually thought that Nick's idea was the answer to that: users create a custom interface, something like this: public interface MyLogger extends Logger { @LoggingLevel(name=DIAG) void diag(String message); // optional other methods } They get an instance of this interface by

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Ralph Goers
Scott would like users to add a level definition to the logging configuration and have everything else happen auto-magically. That would happen at run-time which is a bit late since the methods need to be available at compile time. I believe Scott said he would be fine if users had to do

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Scott Deboy
Yes, I would like to declare in the config: Level: NOTICE, value: 232 And in Java code be able to use logger.notice(some message). But I think that'd require invokedynamic..which would probably require..javassist/ASM? I'd be ok with anything that's really close to that :) Scott On 1/26/14,

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Remko Popma
Sure, but what's wrong with the idea? The user provide their own interface, so that interface exists at compile time. The interface uses annotations, so it does not need to explicitly refer to a custom Level instance. Only the /implementation/ needs to know about the custom Level instances, and

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Remko Popma
In addition to the above, we could provide a tool to generate a MyLogger interface with 14 method signatures for each custom Level name. This would be an offline tool that users would use only once. But this tool is optional... On Monday, January 27, 2014, Remko Popma remko.po...@gmail.com wrote:

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Remko Popma
Nick, I thought that you meant that users would provide their own interface, like this: public interface MyLogger extends Logger { @LoggingLevel(name=DIAG) void diag(String message); // optional other methods } That way, this interface exists at compile time. On Monday, January 27,

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Scott Deboy
Could we leverage Rhino? :) Scott On 1/26/14, Nicholas Williams nicho...@nicholaswilliams.net wrote: Scott, invokedynamic and javassist...those are all /runtime/ things. The user needs Logger#notice to be available at compile time. Those are not compatible. Nick Sent from my iPhone, so

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Scott Deboy
Of course, they'd have to use rhino, or something else...which doesn't help. Where's duck typing when you need it :) On 1/26/14, Scott Deboy scott.de...@gmail.com wrote: Could we leverage Rhino? :) Scott On 1/26/14, Nicholas Williams nicho...@nicholaswilliams.net wrote: Scott,

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Nicholas Williams
Yes, I was saying that. But, unless I'm misunderstanding, Scott doesn't want the user to even have to write the interface. He wants them to just configure it and the interface become available magically. I was pointing out that there's a disconnect between when the configuration is used

Re: Using Custom Levels with a Custom/Wrapper Interface

2014-01-26 Thread Matt Sicker
If we go the run-once tool route, then you might as well use annotation processing. I think it would support everything necessary to generate the appropriate custom logger class. On 26 January 2014 23:00, Scott Deboy scott.de...@gmail.com wrote: Of course, they'd have to use rhino, or