Changeset 4ead7b3


Ignore:
Timestamp:
Aug 16, 2017, 12:53:41 PM (7 years ago)
Author:
Jason Gross <jasongross9@gmail.com>
Branches:
master
Children:
42779f8
Parents:
5093c6f
git-author:
Jason Gross <jgross@mit.edu> (07/12/11 17:10:09)
git-committer:
Jason Gross <jasongross9@gmail.com> (08/16/17 12:53:41)
Message:
Moved notification of message logging to perl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • logging.c

    r5093c6f r4ead7b3  
    1717static bool defer_logs; /* to be accessed only on the disk-writing thread */
    1818static GQueue *deferred_entry_queue;
    19 
    20 /* This is now the one function that should be called to log a
    21  * message.  It will do all the work necessary by calling the other
    22  * functions in this file as necessary.
    23  */
    24 void owl_log_message(const owl_message *m) {
    25   owl_function_debugmsg("owl_log_message: entering");
    26 
    27   if (m == NULL) {
    28     owl_function_debugmsg("owl_log_message: passed null message");
    29     return;
    30   }
    31 
    32   g_free(owl_perlconfig_call_with_message("BarnOwl::Logging::log", m));
    33 
    34   owl_function_debugmsg("owl_log_message: leaving");
    35 }
    3619
    3720static void owl_log_error_main_thread(gpointer data)
  • owl.c

    r441fd42 r4ead7b3  
    230230  /* let perl know about it */
    231231  owl_perlconfig_newmsg(m, NULL);
    232   /* log the message if we need to */
    233   owl_log_message(m);
    234232  /* redraw the sepbar; TODO: don't violate layering */
    235233  owl_global_sepbar_dirty(&g);
  • perl/lib/BarnOwl/Logging.pm

    r5093c6f r4ead7b3  
    3333
    3434use File::Spec;
     35
     36$BarnOwl::Hooks::newMessage->add("BarnOwl::Logging::log");
    3537
    3638=head2 sanitize_filename BASE_PATH FILENAME
     
    116118sub log {
    117119    my ($m) = @_;
     120    return unless defined $m;
    118121    return unless BarnOwl::Logging::should_log_message($m);
    119122    my $log_text = $m->log;
Note: See TracChangeset for help on using the changeset viewer.