pike.git / lib / modules / Search.pmod / Utils.pmod

version» Context lines:

pike.git/lib/modules/Search.pmod/Utils.pmod:1:   // This file is part of Roxen Search   // Copyright © 2001 Roxen IS. All rights reserved.   // - // $Id: Utils.pmod,v 1.45 2007/03/15 13:28:45 jonasw Exp $ + // $Id: Utils.pmod,v 1.46 2007/05/16 07:10:12 noring Exp $      #if !constant(report_error)   #define report_error werror   #define report_debug werror   #define report_warning werror   #endif      #ifdef SEARCH_DEBUG   # define WERR(X) report_debug("search: "+(X)+"\n");   #else
pike.git/lib/modules/Search.pmod/Utils.pmod:709:    mapping types = ([ "error" : "Error",    "warning" : "Warning",    "notice" : "Notice", ]);       werror(sprintf("%sSearch: %s: %s\n",    " : ",    types[type],    extra?sprintf(codes[(int)code], @(extra/"\n")):codes[(int)code]));    }    +  void log_purge(int days) +  { +  Sql.Sql db = get_db(); +  if(!db) return; +  if(days) +  db->query("DELETE FROM eventlog " +  " WHERE at <= NOW() - INTERVAL "+days+" DAY"); +  else +  db->query("DELETE FROM eventlog"); +  } +     //!    void log_event( int code, string type, void|string extra, void|int log_profile ) {    Sql.Sql db = get_db();    if(!db) return;       if(zero_type(log_profile))    log_profile = profile;       if(stderr_logging)    werror_event(code, type, extra, log_profile);