parent
aab243592f
commit
1d316710ed
|
@ -707,20 +707,32 @@ log_write (session *sess, char *text, time_t ts)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sess->logfd == -1)
|
if (sess->logfd == -1)
|
||||||
|
{
|
||||||
log_open (sess);
|
log_open (sess);
|
||||||
|
}
|
||||||
|
|
||||||
/* change to a different log file? */
|
/* change to a different log file? */
|
||||||
file = log_create_pathname (sess->server->servername, sess->channel, server_get_network (sess->server, FALSE));
|
file = log_create_pathname (sess->server->servername, sess->channel, server_get_network (sess->server, FALSE));
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
if (g_access (file, F_OK) != 0)
|
if (g_access (file, F_OK) != 0)
|
||||||
|
{
|
||||||
|
if (sess->logfd != -1)
|
||||||
{
|
{
|
||||||
close (sess->logfd);
|
close (sess->logfd);
|
||||||
|
}
|
||||||
|
|
||||||
sess->logfd = log_open_file (sess->server->servername, sess->channel, server_get_network (sess->server, FALSE));
|
sess->logfd = log_open_file (sess->server->servername, sess->channel, server_get_network (sess->server, FALSE));
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (file);
|
g_free (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sess->logfd == -1)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (prefs.hex_stamp_log)
|
if (prefs.hex_stamp_log)
|
||||||
{
|
{
|
||||||
if (!ts) ts = time(0);
|
if (!ts) ts = time(0);
|
||||||
|
@ -731,6 +743,7 @@ log_write (session *sess, char *text, time_t ts)
|
||||||
g_free (stamp);
|
g_free (stamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
temp = strip_color (text, -1, STRIP_ALL);
|
temp = strip_color (text, -1, STRIP_ALL);
|
||||||
len = strlen (temp);
|
len = strlen (temp);
|
||||||
write (sess->logfd, temp, len);
|
write (sess->logfd, temp, len);
|
||||||
|
|
Loading…
Reference in New Issue