Changeset bf61c61


Ignore:
Timestamp:
Jan 7, 2014, 6:02:20 PM (8 years ago)
Author:
Jason Gross <jgross@mit.edu>
Children:
023f405
Parents:
6e764aa
git-author:
Jason Gross <jgross@mit.edu> (07/12/11 17:10:09)
git-committer:
Jason Gross <jgross@mit.edu> (01/07/14 18:02:20)
Message:
Moved notification of message logging to perl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • logging.c

    r6e764aa rbf61c61  
    1111static GMainLoop *log_loop;
    1212static GThread *logging_thread;
    13 
    14 /* This is now the one function that should be called to log a
    15  * message.  It will do all the work necessary by calling the other
    16  * functions in this file as necessary.
    17  */
    18 void owl_log_message(const owl_message *m) {
    19   owl_function_debugmsg("owl_log_message: entering");
    20 
    21   if (m == NULL) {
    22     owl_function_debugmsg("owl_log_message: passed null message");
    23     return;
    24   }
    25 
    26   g_free(owl_perlconfig_call_with_message("BarnOwl::Logging::log", m));
    27 
    28   owl_function_debugmsg("owl_log_message: leaving");
    29 }
    3013
    3114static void owl_log_error_main_thread(gpointer data)
  • owl.c

    r441fd42 rbf61c61  
    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

    r6e764aa rbf61c61  
    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.