Lines Matching refs:log_info

91 struct log_info {  struct
158 static void do_log_line(struct log_info *log_info, char *line) { in do_log_line() argument
159 if (log_info->log_target & LOG_KLOG) { in do_log_line()
160 klog_write(6, log_info->klog_fmt, line); in do_log_line()
162 if (log_info->log_target & LOG_ALOG) { in do_log_line()
163 ALOG(LOG_INFO, log_info->btag, "%s", line); in do_log_line()
165 if (log_info->log_target & LOG_FILE) { in do_log_line()
166 fprintf(log_info->fp, "%s\n", line); in do_log_line()
173 static void log_line(struct log_info *log_info, char *line, int len) { in log_line() argument
174 if (log_info->abbreviated) { in log_line()
175 add_line_to_abbr_buf(&log_info->a_buf, line, len); in log_line()
177 do_log_line(log_info, line); in log_line()
188 static void print_buf_lines(struct log_info *log_info, char *buf, int buf_size) in print_buf_lines() argument
201 do_log_line(log_info, line_start); in print_buf_lines()
207 do_log_line(log_info, line_start); in print_buf_lines()
249 static void print_abbr_buf(struct log_info *log_info) { in print_abbr_buf() argument
250 struct abbr_buf *a_buf = &log_info->a_buf; in print_abbr_buf()
254 print_buf_lines(log_info, a_buf->b_buf.buf, a_buf->b_buf.used_len); in print_abbr_buf()
261 do_log_line(log_info, "...\n"); in print_abbr_buf()
273 print_buf_lines(log_info, a_buf->e_buf.buf + a_buf->e_buf.read, in print_abbr_buf()
288 print_buf_lines(log_info, nbuf, first_chunk_len + a_buf->e_buf.write); in print_abbr_buf()
307 struct log_info log_info; in parent() local
315 log_info.btag = basename(tag); in parent()
316 if (!log_info.btag) { in parent()
317 log_info.btag = (char*) tag; in parent()
324 init_abbr_buf(&log_info.a_buf); in parent()
328 snprintf(log_info.klog_fmt, sizeof(log_info.klog_fmt), in parent()
329 "<6>%.*s: %%s\n", MAX_KLOG_TAG, log_info.btag); in parent()
344 log_info.fp = fdopen(fd, "a"); in parent()
348 log_info.log_target = log_target; in parent()
349 log_info.abbreviated = abbreviated; in parent()
387 log_line(&log_info, &buffer[a], b - a); in parent()
395 log_line(&log_info, &buffer[a], b - a); in parent()
435 log_line(&log_info, &buffer[a], b - a); in parent()
440 print_abbr_buf(&log_info); in parent()
446 "%s terminated by exit(%d)\n", log_info.btag, WEXITSTATUS(status)); in parent()
447 do_log_line(&log_info, tmpbuf); in parent()
452 "%s terminated by signal %d\n", log_info.btag, WTERMSIG(status)); in parent()
453 do_log_line(&log_info, tmpbuf); in parent()
456 "%s stopped by signal %d\n", log_info.btag, WSTOPSIG(status)); in parent()
457 do_log_line(&log_info, tmpbuf); in parent()
464 fclose(log_info.fp); /* Also closes underlying fd */ in parent()
467 free_abbr_buf(&log_info.a_buf); in parent()