clean README and TODO files

loglevels cleanup
debug prints cleanup
log info when connecting to a server
default log level to INFO
This commit is contained in:
kyoshiro 2005-11-17 17:55:12 +00:00
parent ad86ed411d
commit 1e6f0593fb
10 changed files with 27 additions and 50 deletions

14
IDEAS
View File

@ -1,14 +0,0 @@
- parser limité aux join part mode kick kill privmsg notices quit nick names
- parser client : join, part, quit, nick, privmsg/notice
- gestion des chans avec liste des nicks et statut
- backlog avec timestamp à la reconnexion
- logs au format irssi + timestamp complet
- parser de conf (lex) du style var = value
- backlog dans un dir, plusieurs fichiers (un par chan + le reste dans un autre)
- [secondaire] rotate logs
- connection.c: conn, read/write polls, waitevent, ssl transparent et anti flood
- irc.c: gestion des chans, des spécificités d'un client IRC (ping)
- log.c: log et backlog
- client.c: gestion des clients (auth, etc...)
- config.c: lecture et enregistrement de la conf

2
README
View File

@ -1,2 +0,0 @@
log encryption support
salt this md5

8
TODO
View File

@ -1,12 +1,6 @@
Before release:
- SSL certificate verification
- keep invites when detached ?
- allow global (or per net ?) IP filtering
- /bip command for admin (at least rehash, jump, ...)
- check why log_mode doesn't add closing bracket...
- bug: bip using 100% cpu when reconnecting (to SSL only ?)
TODO:
- more /bip commands
- DCC proxying...
- crypt logs

View File

@ -245,8 +245,8 @@ pid_is_there:
}
if (pid)
mylog(LOG_INFO, "pid file found (pid %ld).", pid);
mylog(LOG_INFO, "Another instance of bip is certainly runing.");
mylog(LOG_INFO, "If you are sure this is not the case remove"
mylog(LOG_STD, "Another instance of bip is certainly runing.");
mylog(LOG_STD, "If you are sure this is not the case remove"
" %s.", conf_pid_file);
exit(2);
}
@ -769,7 +769,6 @@ void ircize(list_t *ll)
struct c_channel *chan =
list_it_item(&chit);
struct chan_info *ci = chan_info_new();
printf("%s\n",chan->name);
ci->name = strdup(chan->name);
ci->key = strmaydup(chan->key);
hash_insert(&link->chan_infos,
@ -891,7 +890,7 @@ int main(int argc, char **argv)
conf_log_root = NULL;
conf_log_format = NULL;
conf_log_level = LOG_ERROR;
conf_log_level = LOG_INFO;
conf_backlog = 1;
conf_log = 1;
conf_backlog_lines = 100;

View File

@ -1,7 +1,7 @@
/* A Bison parser, made by GNU Bison 1.875d. */
/* A Bison parser, made by GNU Bison 2.1. */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +15,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
@ -80,6 +80,7 @@
LEX_STRING = 306
};
#endif
/* Tokens. */
#define LEX_IP 258
#define LEX_EQ 259
#define LEX_PORT 260
@ -141,8 +142,8 @@ typedef union YYSTYPE {
void *list;
struct tuple *tuple;
} YYSTYPE;
/* Line 1285 of yacc.c. */
#line 146 "y.tab.h"
/* Line 1447 of yacc.c. */
#line 147 "y.tab.h"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1

View File

@ -1071,8 +1071,6 @@ static connection_t *_connection_new(char *dsthostname, char *dstport,
{
connection_t *conn;
printf("%s\n", dsthostname);
conn = connection_init(1, 0, timeout, 0);
create_socket(dsthostname, dstport, srchostname, srcport, conn);

View File

@ -1870,6 +1870,10 @@ connection_t *irc_server_connect(struct link *link)
struct link_server *ls;
connection_t *conn;
mylog(LOG_INFO, "Connecting user '%s' to network '%s' using server "
"%s:%d", link->username, link->name,
link->serverv[link->cur_server]->host,
link->serverv[link->cur_server]->port);
conn = connection_new(link->serverv[link->cur_server]->host,
link->serverv[link->cur_server]->port,
link->vhost, link->bind_port,

View File

@ -715,7 +715,7 @@ char *log_beautify(char *buf, char *dest)
int done;
if (!buf)
mylog(LOG_INFO, "BUG!");
mylog(LOG_DEBUG, "BUG!");
p = strchr(buf, ' ');
if (!p || !p[0] || !p[1])
@ -850,9 +850,6 @@ char *log_beautify(char *buf, char *dest)
*p++ = '\r';
*p++ = '\n';
*p = 0;
#if 0
mylog(LOG_INFO, "beautify out: \"%s\"", ret);
#endif
return ret;
}
@ -874,7 +871,7 @@ char *log_backread(log_t *logdata, char *destination)
if (!logdata->backlogging) {
logdata->backlogging = 1;
mylog(LOG_INFO, "backlogging!");
mylog(LOG_DEBUG, "backlogging!");
if (lfg->memlog)
list_it_init(lfg->memlog, &lfg->backlog_it);
else
@ -901,12 +898,12 @@ next_file:
/* check the files containing data to backlog */
lf = list_it_item(&logdata->file_it);
if (lf != list_get_last(&lfg->file_group)) {
mylog(LOG_INFO, "%s not last file!", lf->filename);
mylog(LOG_DEBUG, "%s not last file!", lf->filename);
/* if the file is not the current open for logging
* (it is an old file that has been rotated)
* open if necessary, backlog line per line, and close */
if (!lf->file) {
mylog(LOG_INFO, "opening: %s!", lf->filename);
mylog(LOG_DEBUG, "opening: %s!", lf->filename);
lf->file = fopen(lf->filename, "r");
if (!lf->file) {
mylog(LOG_ERROR, "Can't open %s for reading",
@ -916,7 +913,7 @@ next_file:
return _log_wrap("Error reading logfile",
destination);
}
mylog(LOG_INFO, "seeking: %d!", lf->backlog_offset);
mylog(LOG_DEBUG, "seeking: %d!", lf->backlog_offset);
if (fseek(lf->file, lf->backlog_offset, SEEK_SET)) {
log_reinit(lfg);
free(buf);
@ -933,9 +930,9 @@ next_file:
* then the log file is corrupted so we also
* drop this file */
if (pos == LOGLINE_MAXLEN)
mylog(LOG_INFO, "logline too long");
mylog(LOG_DEBUG, "logline too long");
if (c == EOF || pos == LOGLINE_MAXLEN) {
mylog(LOG_INFO, "EOF: %s (%d)!",
mylog(LOG_DEBUG, "EOF: %s (%d)!",
lf->filename,
conf_always_backlog);
@ -969,7 +966,7 @@ next_file:
destination);
}
logdata->lastfile_seeked = 1;
mylog(LOG_INFO, "last file seedked!");
mylog(LOG_DEBUG, "last file seedked!");
}
c = fgetc(lf->file);
@ -990,7 +987,7 @@ next_file:
lf->backlog_offset++;
if (c == EOF || c == '\n' || pos == LOGLINE_MAXLEN) {
if (pos == LOGLINE_MAXLEN) {
mylog(LOG_INFO, "logline too long");
mylog(LOG_DEBUG, "logline too long");
fseek(lf->file, 0, SEEK_END);
/* in the corruption case we alwayse reset
* backlog offset */
@ -1022,7 +1019,7 @@ static char *_log_wrap(char *dest, char *line)
count = snprintf(buf, LOGLINE_MAXLEN + 1,
":" P_IRCMASK " PRIVMSG %s :%s\r\n", dest, line);
if (count >= LOGLINE_MAXLEN + 1) {
mylog(LOG_INFO, "line too long");
mylog(LOG_DEBUG, "line too long");
buf[LOGLINE_MAXLEN - 2] = '\r';
buf[LOGLINE_MAXLEN - 1] = '\n';
buf[LOGLINE_MAXLEN] = 0;

View File

@ -100,7 +100,7 @@ void _mylog(int level, char *fmt, va_list ap)
prefix = "WARNING: ";
break;
case LOG_INFO:
prefix = "INFO: ";
prefix = "";
break;
default:
prefix = "";

View File

@ -17,12 +17,12 @@
#include <unistd.h>
/* Warning: must be in order, 0 = less output */
#define LOG_STD -1
#define LOG_FATAL 0
#define LOG_ERROR 1
#define LOG_WARN 2
#define LOG_INFO 3
#define LOG_DEBUG 4
#define LOG_STD 4
#define LOG_DEBUGVERB 5
#define LOG_DEBUGTOOMUCH 6