Lines Matching refs:log_fd
51 static int log_fd = STDERR_FILENO; variable
57 log_fd = fcntl(log_fd, F_DUPFD_CLOEXEC, 0); in log_init()
58 if (log_fd == -1) { in log_init()
59 log_fd = STDERR_FILENO; in log_init()
61 log_fd_isatty = isatty(log_fd); in log_init()
72 log_fd = open(logfile, O_CREAT | O_RDWR | O_TRUNC, 0640); in logInitLogFile()
73 if (log_fd == -1) { in logInitLogFile()
74 log_fd = STDERR_FILENO; in logInitLogFile()
79 log_fd = fd; in logInitLogFile()
82 log_fd_isatty = (isatty(log_fd) == 1 ? true : false); in logInitLogFile()
119 dprintf(log_fd, "%s", logLevels[ll].prefix); in logLog()
122 dprintf(log_fd, "[%s][%s][%d] ", timestr, logLevels[ll].descr, __hf_pid()); in logLog()
125 dprintf(log_fd, "%s():%d ", fn, ln); in logLog()
130 vdprintf(log_fd, fmt, args); in logLog()
134 dprintf(log_fd, ": %s", strerr); in logLog()
137 dprintf(log_fd, "\033[0m"); in logLog()
139 dprintf(log_fd, "\n"); in logLog()
155 log_fd = fd; in logRedirectLogFD()
156 log_fd_isatty = isatty(log_fd); in logRedirectLogFD()
160 dprintf(log_fd, "%s", msg); in logDirectlyToFD()
176 return log_fd; in logFd()