MCPcopy Index your code
hub / github.com/git/git / logreport

Function logreport

daemon.c:95–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95static void logreport(int priority, const char *err, va_list params)
96{
97 switch (log_destination) {
98 case LOG_DESTINATION_SYSLOG: {
99 char buf[1024];
100 vsnprintf(buf, sizeof(buf), err, params);
101 syslog(priority, "%s", buf);
102 break;
103 }
104 case LOG_DESTINATION_STDERR:
105 /*
106 * Since stderr is set to buffered mode, the
107 * logging of different processes will not overlap
108 * unless they overflow the (rather big) buffers.
109 */
110 fprintf(stderr, "[%"PRIuMAX"] ", (uintmax_t)getpid());
111 vfprintf(stderr, err, params);
112 fputc('\n', stderr);
113 fflush(stderr);
114 break;
115 case LOG_DESTINATION_NONE:
116 break;
117 case LOG_DESTINATION_UNSET:
118 BUG("log destination not initialized correctly");
119 }
120}
121
122__attribute__((format (printf, 1, 2)))
123static void logerror(const char *err, ...)

Callers 3

logerrorFunction · 0.85
loginfoFunction · 0.85
daemon_dieFunction · 0.85

Calls 1

syslogFunction · 0.85

Tested by

no test coverage detected