add mail send if error
modif log entry
add test mode constant

used by DailyStatsDao to avoid sending error mail in unit test context
latest version deployed on prod