12 #include <arc/Thread.h>
13 #include <arc/IString.h>
54 std::ostream&
operator<<(std::ostream& os,
const LoggerFormat& format);
120 const std::string& identifier);
145 static std::string getDefaultIdentifier();
152 void setDomain(std::string domain);
164 std::string identifier;
173 friend std::ostream&
operator<<(std::ostream& os,
290 std::ostream& destination;
325 LogFile(
const std::string& path);
368 void operator=(
const LogFile& unique);
371 std::ofstream destination;
378 class LoggerContextRef;
382 class LoggerContext {
384 friend class LoggerContextRef;
393 std::list<LogDestination*> destinations;
398 LoggerContext(
LogLevel thr):usage_count(0),threshold(thr) { };
400 LoggerContext(
const LoggerContext& ctx):
401 usage_count(0),destinations(ctx.destinations),threshold(ctx.threshold) { };
403 ~LoggerContext(
void);
468 const std::string& subdomain);
476 const std::string& subdomain,
532 const std::list<std::string>& subdomains);
543 const std::string& domain);
587 template<
class T0,
class T1>
589 const T0& t0,
const T1& t1) {
590 msg(LogMessage(level, IString(str, t0, t1)));
593 template<
class T0,
class T1,
class T2>
595 const T0& t0,
const T1& t1,
const T2& t2) {
596 msg(LogMessage(level, IString(str, t0, t1, t2)));
599 template<
class T0,
class T1,
class T2,
class T3>
601 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3) {
602 msg(LogMessage(level, IString(str, t0, t1, t2, t3)));
605 template<
class T0,
class T1,
class T2,
class T3,
class T4>
607 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
609 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4)));
612 template<
class T0,
class T1,
class T2,
class T3,
class T4,
615 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
616 const T4& t4,
const T5& t5) {
617 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4, t5)));
620 template<
class T0,
class T1,
class T2,
class T3,
class T4,
623 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
624 const T4& t4,
const T5& t5,
const T6& t6) {
625 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4, t5, t6)));
628 template<
class T0,
class T1,
class T2,
class T3,
class T4,
629 class T5,
class T6,
class T7>
631 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
632 const T4& t4,
const T5& t5,
const T6& t6,
const T7& t7) {
633 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4, t5, t6, t7)));
650 Logger(
const Logger& unique);
656 void operator=(
const Logger& unique);
663 std::string getDomain();
672 void log(
const LogMessage& message);
681 std::string context_id;
683 LoggerContext context;
685 LoggerContext& getContext(
void);
689 #define rootLoggerMagic (0xF6569201)
690 static Logger *rootLogger;
691 static std::map<std::string,LogLevel>* defaultThresholds;
692 static unsigned int rootLoggerMark;
699 #define rootLogger getRootLogger()
701 #define LOG(LGR, THR, FSTR, ...) { if ((LGR).getThreshold() >= (THR)(LGR).msg((THR), (FSTR), ...); }
703 #endif // __ARC_LOGGER__