#include "options.ih"

void Options::openLog() const
{
    ostringstream pid;
    pid << setfill('0') << setw(4) << (getpid() % 10000) << ' ';
    g_pid = pid.str();

    string optval;
    if (not d_arg->option(&optval, 'l'))
        optval = s_log;

    g_log.open(optval);

    log() << '\n' <<
             g_pid << "Mailhandler starting\n";
}
