package com.atlassian.stash.internal.mail;

import com.atlassian.bitbucket.mail.MailMessage;

/**
 * Logs errors and info to the mail log file, while periodically logging to normal log that mails are failing.
 */
public interface MailLogger {

    /**
     * @param message A debug message to go into the mail log
     */
    void logDebugMessage(String message, Object... args);

    /**
     * @param message A general info message to go into the mail log
     */
    void logInfoMessage(String message, Object... args);

    /**
     * @param message A warning to go into the mail log
     */
    void logWarnMessage(String message, Object... args);

    /**
     * Message was not sent - log it with the given description.
     */
    void logError(String description, MailMessage mailMessage);

    /**
     * Message was not sent - log it with the given description and the exception.
     */
    void logError(String description, MailMessage mailMessage, Exception e);

    /**
     * Flush any pending warnings to the normal logs.
     */
    void flush();

}
