12 #include <arc/Thread.h>
13 #include <arc/IString.h>
62 std::ostream&
operator<<(std::ostream& os,
const LoggerFormat& format);
128 const std::string& identifier);
153 static std::string getDefaultIdentifier();
160 void setDomain(std::string domain);
172 std::string identifier;
181 friend std::ostream&
operator<<(std::ostream& os,
302 std::ostream& destination;
337 LogFile(
const std::string& path);
380 void operator=(
const LogFile& unique);
383 std::ofstream destination;
390 class LoggerContextRef;
394 class LoggerContext {
396 friend class LoggerContextRef;
405 std::list<LogDestination*> destinations;
410 LoggerContext(
LogLevel thr):usage_count(0),threshold(thr) { };
412 LoggerContext(
const LoggerContext& ctx):
413 usage_count(0),destinations(ctx.destinations),threshold(ctx.threshold) { };
415 ~LoggerContext(
void);
480 const std::string& subdomain);
488 const std::string& subdomain,
544 const std::list<std::string>& subdomains);
555 const std::string& domain);
599 template<
class T0,
class T1>
601 const T0& t0,
const T1& t1) {
602 msg(LogMessage(level, IString(str, t0, t1)));
605 template<
class T0,
class T1,
class T2>
607 const T0& t0,
const T1& t1,
const T2& t2) {
608 msg(LogMessage(level, IString(str, t0, t1, t2)));
611 template<
class T0,
class T1,
class T2,
class T3>
613 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3) {
614 msg(LogMessage(level, IString(str, t0, t1, t2, t3)));
617 template<
class T0,
class T1,
class T2,
class T3,
class T4>
619 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
621 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4)));
624 template<
class T0,
class T1,
class T2,
class T3,
class T4,
627 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
628 const T4& t4,
const T5& t5) {
629 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4, t5)));
632 template<
class T0,
class T1,
class T2,
class T3,
class T4,
635 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
636 const T4& t4,
const T5& t5,
const T6& t6) {
637 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4, t5, t6)));
640 template<
class T0,
class T1,
class T2,
class T3,
class T4,
641 class T5,
class T6,
class T7>
643 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
644 const T4& t4,
const T5& t5,
const T6& t6,
const T7& t7) {
645 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4, t5, t6, t7)));
662 Logger(
const Logger& unique);
668 void operator=(
const Logger& unique);
675 std::string getDomain();
684 void log(
const LogMessage& message);
693 std::string context_id;
695 LoggerContext context;
697 LoggerContext& getContext(
void);
701 #define rootLoggerMagic (0xF6569201)
702 static Logger *rootLogger;
703 static std::map<std::string,LogLevel>* defaultThresholds;
704 static unsigned int rootLoggerMark;
711 #define rootLogger getRootLogger()
713 #define LOG(LGR, THR, FSTR, ...) { if ((LGR).getThreshold() >= (THR)(LGR).msg((THR), (FSTR), ...); }
715 #endif // __ARC_LOGGER__