diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-05-19 18:20:33 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-05-19 18:20:33 +0100 |
commit | a5880d645c2bbf8dfae6daabb1d3c3c66e3c310b (patch) | |
tree | b9ecd641458038dc1ae09cfbd2cbc61f7fbd9d2d /logging.h | |
parent | 1b3539a50d29a8956aa0bd2e668681e8afb968c0 (diff) |
Rewrite logging function to enable logging JOINs/PARTs as well as PRIVMSGs.
Diffstat (limited to 'logging.h')
-rw-r--r-- | logging.h | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -6,6 +6,7 @@ #include <time.h> #include <limits.h> #include <sys/stat.h> +#include <ctype.h> #include "functions.h" @@ -15,16 +16,29 @@ #define SOURCE_SERVER 0 #define SOURCE_CLIENT 1 +#define LOG_PRIVMSG 0 +#define LOG_JOINPART 1 // Write the line 'str' to the relevant log file such as // '#channel.log' or 'nickname.log'. 'ournick' is our own -// nick and is used to determine which log file to write to. +// nick and is used to determine which log file to write to +// if the type is LOG_PRIVMSG. // 'basedir' is the directory in which the 'logs' directory // will be created in which logs are to be written. -// Expects a string in the format: +// +// If LOG_PRIVMSG then it expects a string in the format: // :from!bar@baz PRIVMSG to :hello world -// With the ":foo!bar@baz "prefix being important. +// +// If LOG_JOINPART then +// Expects a string in the format: +// :nick!bar@baz JOIN :#blabouncer +// or +// :nick!bar@baz PART #blabouncer +// +// With the ":foo!bar@baz "prefix being important for either +// type. +// // Returns 1 on success or 0 on failure. -int logprivmsg(char *str, char *ournick, char *basedir); +int logline(char *str, char *ournick, char *basedir, int type); #endif |