Changeset f809cad for commands.c


Ignore:
Timestamp:
Jan 5, 2013, 3:34:29 PM (9 years ago)
Author:
Jason Gross <jgross@mit.edu>
Children:
48848ae
Parents:
048b1ff
git-author:
Jason Gross <jgross@mit.edu> (09/09/12 20:44:13)
git-committer:
Jason Gross <jgross@mit.edu> (01/05/13 15:34:29)
Message:
Defer failed log messages

Previously, when we failed to open a logging file, we errored, and
dropped the log message.  This commit makes it so that, if the reason we
failed was a permissions error, we instead add the log entry to a queue
of messages to be logged eventually, and inform the user that logging
has been suspended.  The user must run :flush-logs to resume logging.

If :flush-log has an fopen that fails with EPERM or EACCES, we re-defer
messages and inform the user.

On shutdown, BarnOwl will attempt to log all messages currently in the
queue one last time.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r39a531d rf809cad  
    490490              "\n"
    491491              "SEE ALSO: aaway, zaway"),
     492
     493  OWLCMD_VOID("flush-logs", owl_command_flushlogs, OWL_CTX_ANY,
     494               "flush the queue of messages waiting to be logged",
     495               "",
     496               "If BarnOwl failed to log a file, this command tells\n"
     497               "BarnOwl to try logging the messages that have since\n"
     498               "come in, and to resume logging normally."),
    492499
    493500  OWLCMD_ARGS("load-subs", owl_command_loadsubs, OWL_CTX_ANY,
     
    14361443{
    14371444  owl_function_unsuball();
     1445}
     1446
     1447void owl_command_flushlogs(void)
     1448{
     1449  owl_log_flush_logs();
    14381450}
    14391451
Note: See TracChangeset for help on using the changeset viewer.