9 #ifndef __libutilxx__sella__util__Log_H__
10 #define __libutilxx__sella__util__Log_H__
12 #include "../../common.h"
13 #include "LogFormat.h"
14 #include "SimpleLogFormat.h"
15 #include "LogException.h"
16 #include "../Exception.h"
25 #include <unordered_set>
30 #define LOG_INSTANCE (*libutilxx__log)
31 #define AUTO_LOG_INSTANCE
62 #define TRACE(option, format, ...) (((LOG_INSTANCE).isTraceOption(option)) ? ((LOG_INSTANCE).trace(option, __func__, __FILE__, __LINE__, format, ##__VA_ARGS__)) : false )
63 #define LOG(facility, level, format, ...) ((LOG_INSTANCE).write(facility, level, __func__, __FILE__, __LINE__, format, ##__VA_ARGS__))
64 #define LOG2(level, format, ...) ((LOG_INSTANCE).write(level, __func__, __FILE__, __LINE__, format, ##__VA_ARGS__))
65 #define EXCEPTION(e, format, ...) ((LOG_INSTANCE).write(LOG_ALERT, __func__, __FILE__, __LINE__, e, format, ##__VA_ARGS__))
67 #define SET_TRACE(option) ((LOG_INSTANCE).setTraceOption(option, true))
68 #define SET_TRACE2(option, on) ((LOG_INSTANCE).setTraceOption(option, on))
69 #define UNSET_TRACE(option) ((LOG_INSTANCE).setTraceOption(option, false))
70 #define IS_TRACE(option) ((LOG_INSTANCE).isTraceOption(option))
71 #define HAS_TRACE() ((LOG_INSTANCE).hasTraceOptions()
72 #define CLEAR_TRACE() ((LOG_INSTANCE).clearTraceOptions())
74 #define SET_IDENTIFIER(identifier) ((LOG_INSTANCE).setIdentifier(identifier))
75 #define SET_FACILITY(facility) ((LOG_INSTANCE).setFacility(facility))
76 #define SET_OPTION(option) ((LOG_INSTANCE).setOption(option))
77 #define SET_FORMAT(format) ((LOG_INSTANCE).setFormat(format))
78 #define SET_LOGMASK(mask) ((LOG_INSTANCE).setLogMask(mask))
79 #define SET_LOGSIZE(size) ((LOG_INSTANCE).setLogSize(size))
81 #define DO_PRAGMA(x) _Pragma(#x)
89 #define TODO(x) DO_PRAGMA(message("TODO: " #x))
90 #define FIXME(x) DO_PRAGMA(message("FIXME: " #x))
93 #define HERE(x) do { if (DEBUG_FLAG) LOG2(LOG_INFO, "HERE: " #x); } while (0)
94 #define MARK do { if (DEBUG_FLAG) LOG2(LOG_INFO, "MARK: %s() %s:%d", __func__, __FILE__, __LINE__); } while (0)
96 #define DTRACE(option, format, ...) ((DEBUG_FLAG && (LOG_INSTANCE).isTraceOption(option)) ? ((LOG_INSTANCE).trace(option, __func__, __FILE__, __LINE__, format, ##__VA_ARGS__)) : false )
98 #define DLOG(format, ...) do { if (DEBUG_FLAG) LOG2(LOG_DEBUG, format, ##__VA_ARGS__); } while (0)
99 #define DLOG_IF(format, ...) do { if (DEBUG_FLAG) LOG2_IF(LOG_DEBUG, format, ##__VA_ARGS__); } while (0)
100 #define DLOG_EVERY_N(cnt, format, ...) do { if (DEBUG_FLAG) LOG2_EVERY_N(cnt, LOG_DEBUG, format, ##__VA_ARGS__); } while (0)
101 #define DLOG_IF_EVERY_N(cond, cnt, format, ...) do { if (DEBUG_FLAG) LOG2_IF_EVERY_N((cond), cnt, LOG_DEBUG, format, ##__VA_ARGS__); } while (0)
102 #define DLOG_FIRST_N(cnt, format, ...) do { if (DEBUG_FLAG) LOG2_FIRST_N(cnt, LOG_DEBUG, format, ##__VA_ARGS__); } while (0)
103 #define DLOG_IF_FIRST_N(cond, cnt, format, ...) do { if (DEBUG_FLAG) LOG2_IF_FIRST_N((cond), cnt, LOG_DEBUG, format, ##__VA_ARGS__); } while (0)
105 #define EMERGENCY(format, ...) LOG2(LOG_EMERG, format, ##__VA_ARGS__)
106 #define ALERT(format, ...) LOG2(LOG_ALERT, format, ##__VA_ARGS__)
107 #define CRITICAL(format, ...) LOG2(LOG_CRIT, format, ##__VA_ARGS__)
108 #define ERROR(format, ...) LOG2(LOG_ERR, format, ##__VA_ARGS__)
109 #define WARNING(format, ...) LOG2(LOG_WARNING, format, ##__VA_ARGS__)
110 #define NOTICE(format, ...) LOG2(LOG_NOTICE, format, ##__VA_ARGS__)
111 #define INFO(format, ...) LOG2(LOG_INFO, format, ##__VA_ARGS__)
112 #define DEBUG(format, ...) LOG2(LOG_DEBUG, format, ##__VA_ARGS__)
114 #define EMERGENCY_IF(cond, format, ...) LOG2_IF((cond), LOG_EMERG, format, ##__VA_ARGS__)
115 #define ALERT_IF(cond, format, ...) LOG2_IF((cond), LOG_ALERT, format, ##__VA_ARGS__)
116 #define CRITICAL_IF(cond, format, ...) LOG2_IF((cond), LOG_CRIT, format, ##__VA_ARGS__)
117 #define ERROR_IF(cond, format, ...) LOG2_IF((cond), LOG_ERR, format, ##__VA_ARGS__)
118 #define WARNING_IF(cond, format, ...) LOG2_IF((cond), LOG_WARNING, format, ##__VA_ARGS__)
119 #define NOTICE_IF(cond, format, ...) LOG2_IF((cond), LOG_NOTICE, format, ##__VA_ARGS__)
120 #define INFO_IF(cond, format, ...) LOG2_IF((cond), LOG_INFO, format, ##__VA_ARGS__)
121 #define DEBUG_IF(cond, format, ...) LOG2_IF((cond), LOG_DEBUG, format, ##__VA_ARGS__)
123 #define EMERGENCY_TIME(next, sec, format, ...) LOG2_TIME(next, sec, LOG_EMERG, format, ##__VA_ARGS__)
124 #define ALERT_TIME(next, sec, format, ...) LOG2_TIME(next, sec, LOG_ALERT, format, ##__VA_ARGS__)
125 #define CRITICAL_TIME(next, sec, format, ...) LOG2_TIME(next, sec, LOG_CRIT, format, ##__VA_ARGS__)
126 #define ERROR_TIME(next, sec, format, ...) LOG2_TIME(next, sec, LOG_ERR, format, ##__VA_ARGS__)
127 #define WARNING_TIME(next, sec, format, ...) LOG2_TIME(next, sec, LOG_WARNING, format, ##__VA_ARGS__)
128 #define NOTICE_TIME(next, sec, format, ...) LOG2_TIME(next, sec, LOG_NOTICE, format, ##__VA_ARGS__)
129 #define INFO_TIME(next, sec, format, ...) LOG2_TIME(next, sec, LOG_INFO, format, ##__VA_ARGS__)
130 #define DEBUG_TIME(next, sec, format, ...) LOG2_TIME(next, sec, LOG_DEBUG, format, ##__VA_ARGS__)
132 #define EMERGENCY_IF_TIME(next, sec, format, ...) LOG2_IF_TIME((cond), next, sec, LOG_EMERG, format, ##__VA_ARGS__)
133 #define ALERT_IF_TIME(next, sec, format, ...) LOG2_IF_TIME((cond), next, sec, LOG_ALERT, format, ##__VA_ARGS__)
134 #define CRITICAL_IF_TIME(next, sec, format, ...) LOG2_IF_TIME((cond), next, sec, LOG_CRIT, format, ##__VA_ARGS__)
135 #define ERROR_IF_TIME(next, sec, format, ...) LOG2_IF_TIME((cond), next, sec, LOG_ERR, format, ##__VA_ARGS__)
136 #define WARNING_IF_TIME(next, sec, format, ...) LOG2_IF_TIME((cond), next, sec, LOG_WARNING, format, ##__VA_ARGS__)
137 #define NOTICE_IF_TIME(next, sec, format, ...) LOG2_IF_TIME((cond), next, sec, LOG_NOTICE, format, ##__VA_ARGS__)
138 #define INFO_IF_TIME(next, sec, format, ...) LOG2_IF_TIME((cond), next, sec, LOG_INFO, format, ##__VA_ARGS__)
139 #define DEBUG_IF_TIME(next, sec, format, ...) LOG2_IF_TIME((cond), next, sec, LOG_DEBUG, format, ##__VA_ARGS__)
141 #define EMERGENCY_EVERY_N(cnt, format, ...) LOG2_EVERY_N(cnt, LOG_EMERG, format, ##__VA_ARGS__)
142 #define ALERT_EVERY_N(cnt, format, ...) LOG2_EVERY_N(cnt, LOG_ALERT, format, ##__VA_ARGS__)
143 #define CRITICAL_EVERY_N(cnt, format, ...) LOG2_EVERY_N(cnt, LOG_CRIT, format, ##__VA_ARGS__)
144 #define ERROR_EVERY_N(cnt, format, ...) LOG2_EVERY_N(cnt, LOG_ERR, format, ##__VA_ARGS__)
145 #define WARNING_EVERY_N(cnt, format, ...) LOG2_EVERY_N(cnt, LOG_WARNING, format, ##__VA_ARGS__)
146 #define NOTICE_EVERY_N(cnt, format, ...) LOG2_EVERY_N(cnt, LOG_NOTICE, format, ##__VA_ARGS__)
147 #define INFO_EVERY_N(cnt, format, ...) LOG2_EVERY_N(cnt, LOG_INFO, format, ##__VA_ARGS__)
148 #define DEBUG_EVERY_N(cnt, format, ...) LOG2_EVERY_N(cnt, LOG_DEBUG, format, ##__VA_ARGS__)
150 #define EMERGENCY_IF_EVERY_N(cond, cnt, format, ...) LOG2_IF_EVERY_N((cond), cnt, LOG_EMERG, format, ##__VA_ARGS__)
151 #define ALERT_IF_EVERY_N(cond, cnt, format, ...) LOG2_IF_EVERY_N((cond), cnt, LOG_ALERT, format, ##__VA_ARGS__)
152 #define CRITICAL_IF_EVERY_N(cond, cnt, format, ...) LOG2_IF_EVERY_N((cond), cnt, LOG_CRIT, format, ##__VA_ARGS__)
153 #define ERROR_IF_EVERY_N(cond, cnt, format, ...) LOG2_IF_EVERY_N((cond), cnt, LOG_ERR, format, ##__VA_ARGS__)
154 #define WARNING_IF_EVERY_N(cond, cnt, format, ...) LOG2_IF_EVERY_N((cond), cnt, LOG_WARNING, format, ##__VA_ARGS__)
155 #define NOTICE_IF_EVERY_N(cond, cnt, format, ...) LOG2_IF_EVERY_N((cond), cnt, LOG_NOTICE, format, ##__VA_ARGS__)
156 #define INFO_IF_EVERY_N(cond, cnt, format, ...) LOG2_IF_EVERY_N((cond), cnt, LOG_INFO, format, ##__VA_ARGS__)
157 #define DEBUG_IF_EVERY_N(cond, cnt, format, ...) LOG2_IF_EVERY_N((cond), cnt, LOG_DEBUG, format, ##__VA_ARGS__)
159 #define EMERGENCY_FIRST_N(cnt, format, ...) LOG2_FIRST_N(cnt, LOG_EMERG, format, ##__VA_ARGS__)
160 #define ALERT_FIRST_N(cnt, format, ...) LOG2_FIRST_N(cnt, LOG_ALERT, format, ##__VA_ARGS__)
161 #define CRITICAL_FIRST_N(cnt, format, ...) LOG2_FIRST_N(cnt, LOG_CRIT, format, ##__VA_ARGS__)
162 #define ERROR_FIRST_N(cnt, format, ...) LOG2_FIRST_N(cnt, LOG_ERR, format, ##__VA_ARGS__)
163 #define WARNING_FIRST_N(cnt, format, ...) LOG2_FIRST_N(cnt, LOG_WARNING, format, ##__VA_ARGS__)
164 #define NOTICE_FIRST_N(cnt, format, ...) LOG2_FIRST_N(cnt, LOG_NOTICE, format, ##__VA_ARGS__)
165 #define INFO_FIRST_N(cnt, format, ...) LOG2_FIRST_N(cnt, LOG_INFO, format, ##__VA_ARGS__)
166 #define DEBUG_FIRST_N(cnt, format, ...) LOG2_FIRST_N(cnt, LOG_DEBUG, format, ##__VA_ARGS__)
168 #define EMERGENCY_IF_FIRST_N(cond, cnt, format, ...) LOG2_IF_FIRST_N((cond), cnt, LOG_EMERG, format, ##__VA_ARGS__)
169 #define ALERT_IF_FIRST_N(cond, cnt, format, ...) LOG2_IF_FIRST_N((cond), cnt, LOG_ALERT, format, ##__VA_ARGS__)
170 #define CRITICAL_IF_FIRST_N(cond, cnt, format, ...) LOG2_IF_FIRST_N((cond), cnt, LOG_CRIT, format, ##__VA_ARGS__)
171 #define ERROR_IF_FIRST_N(cond, cnt, format, ...) LOG2_IF_FIRST_N((cond), cnt, LOG_ERR, format, ##__VA_ARGS__)
172 #define WARNING_IF_FIRST_N(cond, cnt, format, ...) LOG2_IF_FIRST_N((cond), cnt, LOG_WARNING, format, ##__VA_ARGS__)
173 #define NOTICE_IF_FIRST_N(cond, cnt, format, ...) LOG2_IF_FIRST_N((cond), cnt, LOG_NOTICE, format, ##__VA_ARGS__)
174 #define INFO_IF_FIRST_N(cond, cnt, format, ...) LOG2_IF_FIRST_N((cond), cnt, LOG_INFO, format, ##__VA_ARGS__)
175 #define DEBUG_IF_FIRST_N(cond, cnt, format, ...) LOG2_IF_FIRST_N((cond), cnt, LOG_DEBUG, format, ##__VA_ARGS__)
177 #define LOG_IF(cond, facility, level, format, ...) ((cond) && LOG(facility, level, format, ##__VA_ARGS__))
178 #define LOG2_IF(cond, level, format, ...) ((cond) && LOG2(level, format, ##__VA_ARGS__))
179 #define LOG_TIME(next, sec, level, format, ...) ((LOG_INSTANCE).isTime(next, sec) && LOG(level, format, ##__VA_ARGS__))
180 #define LOG2_TIME(next, sec, level, format, ...) ((LOG_INSTANCE).isTime(next, sec) && LOG2(level, format, ##__VA_ARGS__))
181 #define LOG_IF_TIME(next, sec, level, format, ...) ((cond) && (LOG_INSTANCE).isTime(next, sec) && LOG(level, format, ##__VA_ARGS__))
182 #define LOG2_IF_TIME(next, sec, level, format, ...) ((cond) && (LOG_INSTANCE).isTime(next, sec) && LOG2(level, format, ##__VA_ARGS__))
183 #define LOG_EVERY_N(cnt, level, format, ...) ((LOG_INSTANCE).incEveryN(cnt) && LOG(level, format, ##__VA_ARGS__))
184 #define LOG2_EVERY_N(cnt, level, format, ...) ((LOG_INSTANCE).incEveryN(cnt) && LOG2(level, format, ##__VA_ARGS__))
185 #define LOG_IF_EVERY_N(cond, cnt, level, format, ...) ((cond) && (LOG_INSTANCE).incEveryN(cnt) && LOG(level, format, ##__VA_ARGS__))
186 #define LOG2_IF_EVERY_N(cond, cnt, level, format, ...) ((cond) && (LOG_INSTANCE).incEveryN(cnt) && LOG2(level, format, ##__VA_ARGS__))
187 #define LOG_FIRST_N(cnt, level, format, ...) ((LOG_INSTANCE).incFirstN(cnt) && LOG(level, format, ##__VA_ARGS__))
188 #define LOG2_FIRST_N(cnt, level, format, ...) ((LOG_INSTANCE).incFirstN(cnt) && LOG2(level, format, ##__VA_ARGS__))
189 #define LOG_IF_FIRST_N(cond, cnt, level, format, ...) ((cond) && (LOG_INSTANCE).incFirstN(cnt) && LOG(level, format, ##__VA_ARGS__))
190 #define LOG2_IF_FIRST_N(cond, cnt, level, format, ...) ((cond) && (LOG_INSTANCE).incFirstN(cnt) && LOG2(level, format, ##__VA_ARGS__))
192 #define TRACE_IF(cond, option, format, ...) ((cond) && TRACE(option, format, ##__VA_ARGS__))
193 #define TRACE_TIME(next, sec, option, format, ...) ((LOG_INSTANCE).isTime(next, sec) && TRACE(option, format, ##__VA_ARGS__))
194 #define TRACE_IF_TIME(cond, next, sec, option, format, ...) ((cond) && (LOG_INSTANCE).isTime(next, sec) && TRACE(option, format, ##__VA_ARGS__))
204 typedef std::shared_ptr<Log> shared;
206 typedef std::unordered_set<std::string> option_set;
209 static const int FACILITY_AUTH = LOG_AUTH;
210 static const int FACILITY_AUTHPRIV = LOG_AUTHPRIV;
211 static const int FACILITY_CRON = LOG_CRON;
212 static const int FACILITY_DAEMON = LOG_DAEMON;
213 static const int FACILITY_FTP = LOG_FTP;
214 static const int FACILITY_KERN = LOG_KERN;
215 static const int FACILITY_LOCAL0 = LOG_LOCAL0;
216 static const int FACILITY_LOCAL1 = LOG_LOCAL1;
217 static const int FACILITY_LOCAL2 = LOG_LOCAL2;
218 static const int FACILITY_LOCAL3 = LOG_LOCAL3;
219 static const int FACILITY_LOCAL4 = LOG_LOCAL4;
220 static const int FACILITY_LOCAL5 = LOG_LOCAL5;
221 static const int FACILITY_LOCAL6 = LOG_LOCAL6;
222 static const int FACILITY_LOCAL7 = LOG_LOCAL7;
223 static const int FACILITY_LPR = LOG_LPR;
224 static const int FACILITY_MAIL = LOG_MAIL;
225 static const int FACILITY_NEWS = LOG_NEWS;
226 static const int FACILITY_SYSLOG = LOG_SYSLOG;
227 static const int FACILITY_USER = LOG_USER;
228 static const int FACILITY_UUCP = LOG_UUCP;
230 static const int LEVEL_EMERGENCY = LOG_EMERG;
231 static const int LEVEL_ALERT = LOG_ALERT;
232 static const int LEVEL_CRITICAL = LOG_CRIT;
233 static const int LEVEL_ERROR = LOG_ERR;
234 static const int LEVEL_WARNING = LOG_WARNING;
235 static const int LEVEL_NOTICE = LOG_NOTICE;
236 static const int LEVEL_INFO = LOG_INFO;
237 static const int LEVEL_DEBUG = LOG_DEBUG;
239 static const char* LABEL_EMERGENCY;
240 static const char* LABEL_ALERT;
241 static const char* LABEL_CRITICAL;
242 static const char* LABEL_ERROR;
243 static const char* LABEL_WARNING;
244 static const char* LABEL_NOTICE;
245 static const char* LABEL_INFO;
246 static const char* LABEL_DEBUG;
248 static const int DefaultOption = (LOG_CONS|LOG_NDELAY|LOG_NOWAIT|LOG_PID);
249 static const int WithStderrOption = (LOG_CONS|LOG_NDELAY|LOG_NOWAIT|LOG_PID|LOG_PERROR);
250 static const int DefaultLogMask = LOG_UPTO(LOG_DEBUG);
251 static const size_t DefaultLogSize = 1022;
254 static Log::shared& instance(
const std::string &identifier = std::string());
257 Log(
const std::string &identifier,
int facility,
int option = DefaultOption,
int mask = DefaultLogMask,
const LogFormat &format =
SimpleLogFormat(),
size_t size = DefaultLogSize)
throw (LogException);
260 Log(
const Log &other)
throw ();
261 virtual ~
Log()
throw ();
263 static const Log::shared shared_ptr(
const std::string &identifier,
int facility,
int option = DefaultOption,
int mask = DefaultLogMask,
const LogFormat &format =
SimpleLogFormat(),
size_t size = DefaultLogSize)
throw (LogException);
264 static const Log::shared shared_ptr(
const std::string &file,
const LogFormat &format =
SimpleLogFormat(),
size_t size = DefaultLogSize)
throw (LogException);
266 Log& operator=(
const Log &other)
throw ();
269 static const char* priority(
int level)
throw ();
271 void setIdentifier(
const std::string &identifier = std::string())
throw ();
272 void setFacility(
int facility)
throw ();
273 void setOption(
int option = DefaultOption)
throw ();
274 void setFormat(
const LogFormat &format)
throw ();
276 void setLogLevel(
int level,
bool on =
true)
throw ();
277 int setLogMask(
int mask)
throw ();
278 void setLogSize(
size_t size = DefaultLogSize)
throw ();
279 int getLogMask(
void)
throw ();
280 bool isLogMask(
int level)
throw ();
281 size_t getLogSize(
void)
throw ();
283 void setTraceOption(
const std::string &option,
bool on =
true)
throw ();
284 void setTraceOption(
const std::vector<std::string> &options,
bool on =
true)
throw ();
285 void setTraceOption(
const std::list<std::string> &options,
bool on =
true)
throw ();
286 void setTraceOptions(
const std::vector<std::string> &options,
bool on =
true)
throw ();
287 void setTraceOptions(
const std::list<std::string> &options,
bool on =
true)
throw ();
288 bool isTraceOption(
const char *option)
throw ();
289 bool isTraceOption(
const std::string &option)
throw ();
290 bool isTraceOption(
const std::vector<std::string> &options)
throw ();
291 bool isTraceOption(
const std::list<std::string> &options)
throw ();
292 bool hasTraceOptions(
void)
throw ();
293 void clearTraceOptions(
void)
throw ();
295 bool isTime(time_t &next,
int sec)
throw ();
296 bool incEveryN(uint64_t n)
throw ();
297 bool incFirstN(uint64_t n)
throw ();
298 void resetEveryN(
void)
throw ();
300 bool trace(
const char *option,
const char *func,
const char *file,
int line,
const char *format, ...)
throw ();
301 bool trace(std::string &option,
const char *func,
const char *file,
int line,
const char *format, ...)
throw ();
302 bool trace(
const char *option,
const char *func,
const char *file,
int line,
const std::string &format, ...)
throw ();
303 bool trace(std::string &option,
const char *func,
const char *file,
int line,
const std::string &format, ...)
throw ();
305 bool trace(
const std::vector<std::string> &options,
const char *func,
const char *file,
int line,
const char *format, ...)
throw ();
306 bool trace(
const std::vector<std::string> &options,
const char *func,
const char *file,
int line,
const std::string &format, ...)
throw ();
307 bool trace(
const std::list<std::string> &options,
const char *func,
const char *file,
int line,
const char *format, ...)
throw ();
308 bool trace(
const std::list<std::string> &options,
const char *func,
const char *file,
int line,
const std::string &format, ...)
throw ();
310 bool write(
int facility,
int level,
const char *func,
const char *file,
int line,
const sella::Exception &e,
const std::string &format, ...)
throw ();
311 bool write(
int facility,
int level,
const char *func,
const char *file,
int line,
const std::string &format, ...)
throw ();
313 bool write(
int level,
const char *func,
const char *file,
int line,
const sella::Exception &e)
throw ();
314 bool write(
int level,
const char *func,
const char *file,
int line,
const sella::Exception &e,
const std::string &format, ...)
throw ();
315 bool write(
int level,
const char *func,
const char *file,
int line,
const std::string &format, ...)
throw ();
317 bool write(
int facility,
int level,
const char *func,
const char *file,
int line,
const sella::Exception &e,
const char *format, ...)
throw ();
318 bool write(
int facility,
int level,
const char *func,
const char *file,
int line,
const char *format, ...)
throw ();
320 bool write(
int level,
const char *func,
const char *file,
int line,
const sella::Exception &e,
const char *format, ...)
throw ();
321 bool write(
int level,
const char *func,
const char *file,
int line,
const char *format, ...)
throw ();
324 inline void resize(std::string &text)
throw ();
326 uint64_t &references;
329 std::string identifier;
338 option_set traceOptions;
339 bool allTraceOptions;
341 pthread_spinlock_t mutex;
344 #ifdef AUTO_LOG_INSTANCE
345 extern sella::util::Log::shared libutilxx__log;