Changeset ec36247 for commands.c


Ignore:
Timestamp:
Aug 5, 2017, 11:21:53 PM (7 years ago)
Author:
Jason Gross <jasongross9@gmail.com>
Branches:
master
Children:
77beb3c
Parents:
e47e1b0
git-author:
Jason Gross <jgross@mit.edu> (09/09/12 20:44:13)
git-committer:
Jason Gross <jasongross9@gmail.com> (08/05/17 23:21:53)
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

    r41677d2 rec36247  
    487487              "\n"
    488488              "SEE ALSO: aaway, zaway"),
     489
     490  OWLCMD_VOID("flush-logs", owl_command_flushlogs, OWL_CTX_ANY,
     491              "flush the queue of messages waiting to be logged",
     492              "",
     493              "If BarnOwl failed to log a file, this command tells\n"
     494              "BarnOwl to try logging the messages that have since\n"
     495              "come in, and to resume logging normally."),
    489496
    490497  OWLCMD_ARGS("load-subs", owl_command_loadsubs, OWL_CTX_ANY,
     
    14351442{
    14361443  owl_function_unsuball();
     1444}
     1445
     1446void owl_command_flushlogs(void)
     1447{
     1448  owl_log_flush_logs();
    14371449}
    14381450
Note: See TracChangeset for help on using the changeset viewer.