[Net-IMAP-Server] Logginge

Dan Keder keder at fi.muni.cz
Mon Oct 19 08:32:33 EDT 2009


On 16.10.2009 22:56, Alex Vandiver wrote:
> On Tue, 2009-10-13 at 13:26 +0200, Dan Keder wrote:
>> I refined logging in Net::IMAP::Server. It is possible to log into file,
>> to stdout or using syslog. There are three new options for
>> Net::IMAP::Server->new():
>
> I'm actually not terribly tempted to accept this patch.  The reason why
> is that everyone has a preferred logging format and infrastructure.  For
> instance, we use Log::Log4perl as a log dispatch infrastructure ocally,
> which is what our instance of Net::IMAP::Server uses for logging.  It's
> essentially already required that you subclass Net::IMAP::Server in
> order to use it for anything interesting, so expecting that users will
> override the Net::IMAP::Server::Connection->log (or Net::Server->log,
> see below) method doesn't seem unreasonable.

I put it into the superclass because IMO it had poor logging 
capabilities. Even with the changes I did users can still subclass the 
Net::IMAP::Server module, if they do not find the default logging 
sufficient.

To clarify things, I wanted to make things simpler "by default": When I 
say $server->log("something"), it will handle everything (append 
date/time to the message, send to syslog or write to file etc.).

But all the changes I did can easily be put into a subclass of 
Net::IMAP::Server, so I can live with that :-).


> I'd rather stay away from growing a logging dispatcher on the side of
> Net::IMAP::Server, which is what this looks to be becoming.  However,
> I'd be fine with making the default ->log method be
> Net::IMAP::Server->log instead of Net::IMAP::Server::Connection->log,
> and making use of Net::Server's concept of loglevels throughout
> Net::IMAP::Server's code.

Yes, I would appreciate if the log() method moved to Net::IMAP::Server.
In my opinion It makes more sense to have it there.


>> I also added support for flat mailbox structure, i.e. mailboxes with
>> undefined hierarchy separator. It is in the same diff file (Sorry for
>> that, I am too lazy to separate it. If you need it as two files, I can
>> look into it.).
>
> I applied the hunks associated with this.  In the future, I'd appreciate
> it if you split differing functionality into separate patches.  You also

Yes, I apologize for that. I forgot to make a new branch for it and then 
it was already too late :-(.

> seem to be generating your git patches not against Net::IMAP::Server's
> git repository, but some other repository which also includes
> Net::Server::Coro, which makes them harder to apply.

That is my own IMAP server project repository. If you provide me with an 
URL to your repository, I can use that instead.

dan

-- 
Dan Keder
Faculty of Informatics, Masaryk University
---------------------------------------------------------


More information about the Net-IMAP-Server mailing list