2
0
Fork 0

Compare commits

..

No commits in common. "424e1a37f8d82ecadf49192a4270dc9c149bb918" and "a5d3e11c1f7573c6b4cd1f26ded34cfe9036ae5a" have entirely different histories.

3 changed files with 8 additions and 19 deletions

View File

@ -54,7 +54,7 @@
<parameter name="target" />
<default><text>logging disabled</text></default>
<description>
<html>Enable logging by setting a log target. Supports the same log targets as <a href="plugin_core.html#plugin_core__action_log">log</a>.</html>
<html>Enable logging by setting a log target. Supports the same log targets as <a href="plugin_clore.html#plugin_core__action_log">log</a>.</html>
</description>
<example>
<config>

View File

@ -845,9 +845,6 @@ static void li_connection_reset_keep_alive(liConnection *con) {
li_stream_disconnect(&con->out);
li_stream_disconnect_dest(&con->in);
con->out.out->is_closed = FALSE;
/* reset con->out (== vr->coninfo->resp) counters. con->in is reset on keep-alive "reopen" */
con->out.out->bytes_out = 0;
con->out.out->bytes_in = con->out.out->length;
memset(&con->in_chunked_decode_state, 0, sizeof(con->in_chunked_decode_state));

View File

@ -193,11 +193,6 @@ void li_log_context_set(liLogContext *context, liLogMap *log_map) {
gboolean li_log_write_direct(liServer *srv, liWorker *wrk, GString *path, GString *msg) {
liLogEntry *log_entry;
if (!path || path->len == 0) {
/* ignore empty log targets */
return TRUE;
}
log_entry = g_slice_new(liLogEntry);
log_entry->path = g_string_new_len(GSTR_LEN(path));
log_entry->level = 0;
@ -236,20 +231,20 @@ gboolean li_log_write(liServer *srv, liWorker *wrk, liLogContext *context, liLog
if (log_map != NULL && log_level < LI_LOG_LEVEL_COUNT) {
path = log_map->targets[log_level];
} else {
/* no log map or invalid log level */
return FALSE;
}
if (!path || path->len == 0) {
/* log-level is ignored */
return TRUE;
}
log_line = g_string_sized_new(63);
va_start(ap, fmt);
g_string_vprintf(log_line, fmt, ap);
va_end(ap);
if (!path) {
li_log_write_stderr(srv, log_line->str, TRUE);
g_string_free(log_line, TRUE);
return TRUE;
}
switch (g_atomic_int_get(&srv->state)) {
case LI_SERVER_INIT:
case LI_SERVER_LOADING:
@ -355,10 +350,7 @@ static void log_watcher_cb(liEventBase *watcher, int events) {
log = log_open(srv, log_entry->path);
if (NULL == log) {
/* explicit empty target, ignore */
} else if (-1 == log->fd) {
/* failed opening log file */
if (NULL == log || -1 == log->fd) {
li_log_write_stderr(srv, msg->str, TRUE);
goto next;
}