12 #include <arc/Thread.h>
13 #include <arc/IString.h>
62 std::ostream&
operator<<(std::ostream& os,
const LoggerFormat& format);
133 const std::string& identifier);
158 static std::string getDefaultIdentifier();
165 void setDomain(std::string domain);
177 std::string identifier;
186 friend std::ostream&
operator<<(std::ostream& os,
307 std::ostream& destination;
342 LogFile(
const std::string& path);
385 void operator=(
const LogFile& unique);
388 std::ofstream destination;
395 class LoggerContextRef;
399 class LoggerContext {
401 friend class LoggerContextRef;
410 std::list<LogDestination*> destinations;
415 LoggerContext(
LogLevel thr):usage_count(0),threshold(thr) { };
417 LoggerContext(
const LoggerContext& ctx):
418 usage_count(0),destinations(ctx.destinations),threshold(ctx.threshold) { };
420 ~LoggerContext(
void);
485 const std::string& subdomain);
493 const std::string& subdomain,
549 const std::list<std::string>& subdomains);
560 const std::string& domain);
604 template<
class T0,
class T1>
606 const T0& t0,
const T1& t1) {
607 msg(LogMessage(level, IString(str, t0, t1)));
610 template<
class T0,
class T1,
class T2>
612 const T0& t0,
const T1& t1,
const T2& t2) {
613 msg(LogMessage(level, IString(str, t0, t1, t2)));
616 template<
class T0,
class T1,
class T2,
class T3>
618 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3) {
619 msg(LogMessage(level, IString(str, t0, t1, t2, t3)));
622 template<
class T0,
class T1,
class T2,
class T3,
class T4>
624 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
626 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4)));
629 template<
class T0,
class T1,
class T2,
class T3,
class T4,
632 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
633 const T4& t4,
const T5& t5) {
634 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4, t5)));
637 template<
class T0,
class T1,
class T2,
class T3,
class T4,
640 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
641 const T4& t4,
const T5& t5,
const T6& t6) {
642 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4, t5, t6)));
645 template<
class T0,
class T1,
class T2,
class T3,
class T4,
646 class T5,
class T6,
class T7>
648 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
649 const T4& t4,
const T5& t5,
const T6& t6,
const T7& t7) {
650 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4, t5, t6, t7)));
667 Logger(
const Logger& unique);
673 void operator=(
const Logger& unique);
680 std::string getDomain();
689 void log(
const LogMessage& message);
698 std::string context_id;
700 LoggerContext context;
702 LoggerContext& getContext(
void);
706 #define rootLoggerMagic (0xF6569201)
707 static Logger *rootLogger;
708 static std::map<std::string,LogLevel>* defaultThresholds;
709 static unsigned int rootLoggerMark;
716 #define rootLogger getRootLogger()
718 #define LOG(LGR, THR, FSTR, ...) { if ((LGR).getThreshold() >= (THR)(LGR).msg((THR), (FSTR), ...); }
720 #endif // __ARC_LOGGER__