Omega Security Services 0.7.3

log.h File Reference

Go to the source code of this file.

Defines

#define LOG_INFO   0
#define DEBUG   1
#define DEBUG_2   2
#define DEBUG3   11
#define LOG_DEBUG   1
#define LOG_DEBUG2   2
#define LOG_DEBUG3   11
#define LOG_ERROR   3
#define LOG_FATAL   4
#define LOG_EVENT   5
#define LOG_LINK   6
#define LOG_USER   7
#define LOG_CHAN   8
#define LOG_IO   9
#define LOG_MODULE   10
#define LOG_SOCKET   13
#define LOG_BACKTRACE   12

Functions

void open_log (void)
void close_logs (void)
void Log (char *,...)
void alog (int, char *,...)
void sendto_logchan (char *,...)
void sendto_console (char *,...)
void CleanUpLogs (int, char **)

Variables

int uselogchan
static FILE * logfd

Define Documentation

#define DEBUG   1

Debug log types

Definition at line 23 of file log.h.

Referenced by alog().

#define DEBUG3   11

Definition at line 25 of file log.h.

Referenced by AddCmd(), AddHelp(), alog(), Event(), and HandleServCmd().

#define DEBUG_2   2

Definition at line 24 of file log.h.

Referenced by alog().

#define LOG_BACKTRACE   12

Backtraceing

Definition at line 55 of file log.h.

Referenced by GenCore().

#define LOG_CHAN   8

Definition at line 46 of file log.h.

#define LOG_DEBUG   1

Definition at line 27 of file log.h.

Referenced by add_access_flag(), add_access_host(), find_access_flag(), new_access(), and set_access_flag().

#define LOG_DEBUG2   2
#define LOG_DEBUG3   11

Definition at line 29 of file log.h.

Referenced by find_uid(), find_user(), parse(), and receive().

#define LOG_ERROR   3
#define LOG_EVENT   5

Standard log types

Definition at line 43 of file log.h.

Referenced by destroy_event_list().

#define LOG_FATAL   4

Definition at line 36 of file log.h.

Referenced by alog(), load_modules(), and load_protocol().

#define LOG_INFO   0

Definition at line 17 of file log.h.

Referenced by SigHandler().

#define LOG_IO   9

Definition at line 47 of file log.h.

#define LOG_LINK   6

Definition at line 44 of file log.h.

#define LOG_MODULE   10

Definition at line 48 of file log.h.

Referenced by load_modules(), module_close(), and run_mod_que().

#define LOG_SOCKET   13

Definition at line 49 of file log.h.

Referenced by OneTimeAround(), and receive().

#define LOG_USER   7

Definition at line 45 of file log.h.

Referenced by AddUser(), exit_one_user(), exit_user(), and NewNick().


Function Documentation

void alog ( int  TYPE,
char *  fmt,
  ... 
)

alog - Checks to see if a log is open, then writes to the log file, also if we are in debug it will print the line to teh console.

Parameters:
TYPE(int) Log type

  • LOG_INFO 0 - Default/Basic log line
  • LOG_DEBUG 1 - Debug information (Only logged if debug is higher then 1)
  • LOG_DEBUG2 2
  • LOG_ERROR 3 - Error
  • LOG_FATAL 4 - Critical/Fatal Error
  • LOG_EVENT 5 - Event related log (Generated by eventengine.c)
  • LOG_LINK 6 - IRCd Link related (Not normally used)
  • LOG_USER 7 - User related logging (Used by the core to log quit/connect)
  • LOG_CHAN 8 - Channel related logging (Not normally used)
  • LOG_IO 9 - Raw Input out put logging (Please do not use CORE/SOCKETENGINE only)
  • LOG_MODULE 10 - Module LOAD/UNLOAD/Error
  • LOG_SOCKET 11 - Socketengine logging
  • LOG_BACKTRACE 12 - Used if backtrace is enabled
  • LOG_DEBUG3 13 - Socket debug level logging
fmt(char*) Format string for variable arguments
...(mixed) Variable arguements.

XXX- Use constants as opposed to numeric values - this will prevent bad logging in the future.

Definition at line 109 of file log.c.

References debug, DEBUG, DEBUG3, DEBUG_2, LOG_FATAL, logfd, LogType, nofork, open_log(), and ServerTime.

Referenced by add_access_flag(), add_access_host(), add_protocol(), AddCmd(), AddEventEx(), AddHelp(), AddUser(), Core_Construct(), dest_all_threads(), destroy_event_list(), do_cmd(), ev_connectuplink(), Event(), exit_one_user(), exit_user(), find_access_flag(), find_uid(), find_user(), GenCore(), generate_p10_uid(), GetLine(), HandleClientCmds(), HandleServCmd(), KickFromChannel(), Listen(), load_modules(), load_protocol(), Log(), module_close(), new_access(), new_chan(), NewNick(), OneTimeAround(), parse(), receive(), run_mod_que(), send_line(), sendto_socket(), set_access_flag(), SigHandler(), sock_getbyte(), sock_readline(), spawn_thread(), and thread_cancle().

void CleanUpLogs ( int  ,
char **   
)
void close_logs ( void  )

Definition at line 68 of file log.c.

References logfd.

void Log ( char *  fmt,
  ... 
)

Log - This function logs to our log file, as well as sends to logchan... This doesnt do any implicit checks, and will rely on the user to know what he/she is doing.

Parameters:
TYPE- The log level/type
fmt- Formatted VA_ARG strings, or standard parameters.
Returns:
void

Definition at line 218 of file log.c.

References alog(), and sendto_logchan().

Referenced by new_serv().

void open_log ( void  )

Init Function - Called when server starts.

Definition at line 32 of file log.c.

References CfgSettings, curday, DPATH, logfd, LPATH, and Conf::network.

Referenced by alog(), and Run().

void sendto_console ( char *  ,
  ... 
)

Definition at line 189 of file log.c.

Referenced by load_protocol().

void sendto_logchan ( char *  ,
  ... 
)

Variable Documentation

FILE* logfd [static]

Definition at line 7 of file log.h.

Referenced by alog(), close_log(), close_logs(), and open_log().

Definition at line 5 of file log.h.

Referenced by main(), sendto_logchan(), and uplink_cleanup().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines