backlog_no_timestamp option implemented

This commit is contained in:
nohar 2007-01-12 18:49:14 +00:00
parent ccd2274772
commit 9e3d62764f
8 changed files with 23 additions and 8 deletions

View File

@ -81,6 +81,9 @@ if there are more. For example if Coyote told you 12 lines and then RoadRunner
6, you'll only have a replay of the 6 RoadRunner's lines and the last 4 of
Coyote's.
\fBbacklog_no_timestamp\fP (default: \fBfalse\fP)
If true, backlogged line won't include the timestamp.
.TP
\fBblreset_on_talk\fP (default: \fBfalse\fP)
When true, backlog will not be reset upon client disconnection but upon client

2
configure vendored
View File

@ -2028,7 +2028,7 @@ fi
# Define the identity of the package.
PACKAGE=bip
VERSION=0.5.1
VERSION=0.6.0
cat >>confdefs.h <<_ACEOF

View File

@ -1,6 +1,6 @@
AC_INIT(src/bip.c)
AM_CONFIG_HEADER(src/config.h)
AM_INIT_AUTOMAKE(bip,0.5.1)
AM_INIT_AUTOMAKE(bip,0.6.0)
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_YACC

View File

@ -40,6 +40,7 @@ log_level = 3;
#backlog = true; # enable backlog
backlog_lines = 10; # number of lines in backlog, 0 means no limit
always_backlog = true; # backlog even lines already backlogged
#backlog_no_timestamp = false; # Disables time stamps if you find them ugly.
# If blreset_on_talk talking on an irc network has the same effect of issuing
# /bip blreset, meaning that stuffed logged before the command won't be read

View File

@ -51,6 +51,7 @@ int conf_memlog;
int conf_log;
/* number of lines in backlog */
int conf_backlog_lines = 10;
int conf_backlog_no_timestamp;
/* backlog even lines already backlogged */
int conf_always_backlog;
int conf_log_sync_interval;
@ -624,6 +625,9 @@ int fireup(FILE *conf)
case LEX_BACKLOG_LINES:
conf_backlog_lines = t->ndata;
break;
case LEX_BACKLOG_NO_TIMESTAMP:
conf_backlog_no_timestamp = t->ndata;
break;
case LEX_LOG_ROOT:
if (conf_log_root)
free(conf_log_root);

View File

@ -80,7 +80,7 @@ struct tuple *tuple_l_new(int type, void *p)
%}
%token LEX_IP LEX_EQ LEX_PORT LEX_CSS LEX_SEMICOLON LEX_CONNECTION LEX_NETWORK LEX_LBRA LEX_RBRA LEX_USER LEX_NAME LEX_NICK LEX_SERVER LEX_PASSWORD LEX_SRCIP LEX_HOST LEX_VHOST LEX_SOURCE_PORT LEX_NONE LEX_COMMENT LEX_BUNCH LEX_REALNAME LEX_SSL LEX_SSL_CHECK_MODE LEX_SSL_CHECK_STORE LEX_CHANNEL LEX_KEY LEX_LOG_ROOT LEX_LOG_FORMAT LEX_LOG_LEVEL LEX_BACKLOG_LINES LEX_BACKLOG LEX_LOG LEX_LOG_SYNC_INTERVAL LEX_FOLLOW_NICK LEX_ON_CONNECT_SEND LEX_AWAY_NICK LEX_PID_FILE LEX_IGN_FIRST_NICK LEX_ALWAYS_BACKLOG LEX_BLRESET_ON_TALK LEX_DEFAULT_USER LEX_DEFAULT_NICK LEX_DEFAULT_REALNAME LEX_NO_CLIENT_AWAY_MSG LEX_BL_MSG_ONLY
%token LEX_IP LEX_EQ LEX_PORT LEX_CSS LEX_SEMICOLON LEX_CONNECTION LEX_NETWORK LEX_LBRA LEX_RBRA LEX_USER LEX_NAME LEX_NICK LEX_SERVER LEX_PASSWORD LEX_SRCIP LEX_HOST LEX_VHOST LEX_SOURCE_PORT LEX_NONE LEX_COMMENT LEX_BUNCH LEX_REALNAME LEX_SSL LEX_SSL_CHECK_MODE LEX_SSL_CHECK_STORE LEX_CHANNEL LEX_KEY LEX_LOG_ROOT LEX_LOG_FORMAT LEX_LOG_LEVEL LEX_BACKLOG_LINES LEX_BACKLOG_NO_TIMESTAMP LEX_BACKLOG LEX_LOG LEX_LOG_SYNC_INTERVAL LEX_FOLLOW_NICK LEX_ON_CONNECT_SEND LEX_AWAY_NICK LEX_PID_FILE LEX_IGN_FIRST_NICK LEX_ALWAYS_BACKLOG LEX_BLRESET_ON_TALK LEX_DEFAULT_USER LEX_DEFAULT_NICK LEX_DEFAULT_REALNAME LEX_NO_CLIENT_AWAY_MSG LEX_BL_MSG_ONLY
%union {
int number;
@ -111,6 +111,9 @@ command:
| LEX_CSS LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_CSS, $3); }
| LEX_BACKLOG_LINES LEX_EQ LEX_INT { $$ = tuple_i_new(LEX_BACKLOG_LINES,
$3); }
| LEX_BACKLOG_NO_TIMESTAMP LEX_EQ LEX_BOOL {
$$ = tuple_i_new(LEX_BACKLOG_NO_TIMESTAMP, $3);
}
| LEX_BACKLOG LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_BACKLOG,
$3); }
| LEX_BL_MSG_ONLY LEX_EQ LEX_BOOL {

View File

@ -81,6 +81,7 @@ list_t *parse_conf(FILE *file)
"log_root" { return LEX_LOG_ROOT; }
"log_format" { return LEX_LOG_FORMAT; }
"backlog_lines" { return LEX_BACKLOG_LINES; }
"backlog_no_timestamp" { return LEX_BACKLOG_NO_TIMESTAMP; }
"backlog" { return LEX_BACKLOG; }
"bl_msg_only" { return LEX_BL_MSG_ONLY; }
"log" { return LEX_LOG; }

View File

@ -29,6 +29,7 @@ extern int conf_backlog;
extern int conf_backlog_lines;
extern int conf_always_backlog;
extern int conf_bl_msg_only;
extern int conf_backlog_no_timestamp;
int log_set_backlog_offset(log_t *logdata, char *dest);
static int _log_write(log_t *logdata, logfilegroup_t *lf, char *d, char *str);
@ -813,7 +814,7 @@ char *log_beautify(char *buf, char *dest)
return _log_wrap(dest, buf);
p = ret = (char *)malloc(
1 + lon + strlen(LAMESTRING) + lod + 2 + lots + 1 + lom + 3
1 + lon + strlen(LAMESTRING) + lod + 2 + lots + 2 + lom + 3
+ action * (2 + strlen("ACTION ")) + out * strlen(" -> "));
if (!p)
fatal("out of memory");
@ -841,10 +842,12 @@ char *log_beautify(char *buf, char *dest)
strcpy(p, " -> ");
p += strlen(" -> ");
}
memcpy(p, sots, lots);
p += lots;
*p++ = ' ';
if (conf_backlog_no_timestamp == 0) {
memcpy(p, sots, lots);
p += lots;
*p++ = '>';
*p++ = ' ';
}
memcpy(p, som, lom);
p += lom;