[wp-trac] Re: [WordPress Trac] #5669: Provide single logging functions to replace logIO(), debug_fwrite() etc.

WordPress Trac wp-trac at lists.automattic.com
Wed Jan 30 13:59:43 GMT 2008

#5669: Provide single logging functions to replace logIO(), debug_fwrite() etc.
 Reporter:  pishmishy                                            |        Owner:  darkdragon
     Type:  enhancement                                          |       Status:  new       
 Priority:  normal                                               |    Milestone:  2.6       
Component:  General                                              |      Version:  2.3.2     
 Severity:  normal                                               |   Resolution:            
 Keywords:  logging logIO debug_fwrite dubug audit dev-feedback  |  
Comment (by pishmishy):

 Cool. In my very rough drafts I'd defined actions, and default functions
 to hook into those actions for initializing (open a file, connect to a
 database), writing to, and closing logs (close database connection, close
 file). That way logs to files, databases and other places could be

 Each call to the logging function took two arguments a "facility" and a
 message. I left it up to the functions hooked into the actions to decide
 if the data should be logged in that function. For example authentication
 related logs could be sent as log("AUTH",$message); and a hooked function
 to log authentication messages to MySQL could look out for "AUTH".

 Main problem was in deciding the earliest point where I could elegantly
 call the initialization and closing actions whilst still having all the
 plugin functionality available. I hope my thoughts give some idea of what
 you might do, or what not to do.

Ticket URL: <http://trac.wordpress.org/ticket/5669#comment:6>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list