Xfce Forum

Sub domains
 

You are not logged in.

#1 2014-10-23 00:17:49

Wed
Member
Registered: 2011-04-12
Posts: 4

Date format in mailwatcher plugin

Hello all!

I would like to adjust the format of the date in the error log of Mail Watch. How do I go about that?

Last edited by Wed (2014-10-23 00:19:32)

Offline

#2 2014-10-23 02:15:53

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,996

Re: Date format in mailwatcher plugin

Looks like you have to change the source. Specifically in the xfce_mailwatch_log_message function:

void
xfce_mailwatch_log_message(XfceMailwatch *mailwatch,
                           XfceMailwatchMailbox *mailbox,
                           XfceMailwatchLogLevel level,
                           const gchar *fmt,
                           ...)
{
    XfceMailwatchLogEntry   *entry = NULL;
    va_list                 args;
    GList *l;
    GTimeVal                gt;
    
    g_return_if_fail( mailwatch &&
            level < XFCE_MAILWATCH_N_LOG_LEVELS && fmt );
    
    entry = g_new0( XfceMailwatchLogEntry, 1 );
    entry->mailwatch        = mailwatch;
    entry->level            = level;
    g_get_current_time(&gt);
    entry->timestamp        = (time_t)gt.tv_sec;

    va_start( args, fmt );
    entry->message          = g_strdup_vprintf( fmt, args );
    va_end( args );
    
    if(mailbox) {
        /* locked on, captain */
        g_mutex_lock(mailwatch->mailboxes_mx);
        
        for(l = mailwatch->mailboxes; l; l = l->next) {
            XfceMailwatchMailboxData *mdata = l->data;
            
            if(mdata->mailbox == mailbox) {
                entry->mailbox_name = g_strdup(mdata->mailbox_name);
                break;
            }
        }
        
        /* and we're done, unlock */
        g_mutex_unlock(mailwatch->mailboxes_mx);
    }

    g_idle_add( xfce_mailwatch_signal_log_message, entry );
}

I'm guessing at the:

entry->timestamp        = (time_t)gt.tv_sec;

...line.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2014-10-23 09:11:35

Wed
Member
Registered: 2011-04-12
Posts: 4

Re: Date format in mailwatcher plugin

I hoped that wouldn't be the case. But thanks for the response.

Offline

Board footer

Powered by FluxBB