v0.5.0: Support new Log module on Crystal 0.34.0.
Pre-release-
(breaking change) Replace
loggerproperty(oldLoggertype) onEMail::Client::Configclass tologproperty(newLogtype).
The new one is used as the client specific logger.
Thelogger : Loggernamed argument ofEMail::Client::Config.createmethod is replaced to thelog : Logtoo. -
(breaking change) Remove
log_***named arguments fromEMail::Client::Config.create -
Add
.logclass method toEMail::Clinet.
This returns the default logger. -
Add
.log_level=,.log_io=,.log_formatter=class methods toEMail::Clinet.
These change behavior of the default logger. -
(breaking change) Default
on_fatal_errorhandler never exit the program, just re-raise the exception raised during the SMTP session.
In almost cases, the program will be stoped by the unhandled exception.
But, you may need to exit the program explicitly in some cases.
New logging behavior
You can use two kinds of logger(Log type objects), the default logger and the client specific logger.
The default logger is declared on the EMail::Client type. It can be got by EMail::Client.log, and change its behavior by EMail::Client.log_***= methods.
On the other hand, the client specific logger will be set to EMail::Client instance itself by EMail::Client::Config setting. With this, you can use your own logger for the EMail::Client object.
If the EMail::Client object has the client specific logger, the client use it to output the log entries. Otherwise, the client use the default logger.