12 #include <arc/Thread.h>
13 #include <arc/IString.h>
53 std::ostream&
operator<<(std::ostream& os,
const LoggerFormat& format);
119 const std::string& identifier);
144 static std::string getDefaultIdentifier();
151 void setDomain(std::string domain);
163 std::string identifier;
172 friend std::ostream&
operator<<(std::ostream& os,
278 std::ostream& destination;
313 LogFile(
const std::string& path);
356 void operator=(
const LogFile& unique);
359 std::ofstream destination;
366 class LoggerContextRef;
370 class LoggerContext {
372 friend class LoggerContextRef;
381 std::list<LogDestination*> destinations;
386 LoggerContext(
LogLevel thr):usage_count(0),threshold(thr) { };
388 LoggerContext(
const LoggerContext& ctx):
389 usage_count(0),destinations(ctx.destinations),threshold(ctx.threshold) { };
391 ~LoggerContext(
void);
456 const std::string& subdomain);
464 const std::string& subdomain,
520 const std::list<std::string>& subdomains);
531 const std::string& domain);
575 template<
class T0,
class T1>
577 const T0& t0,
const T1& t1) {
578 msg(LogMessage(level, IString(str, t0, t1)));
581 template<
class T0,
class T1,
class T2>
583 const T0& t0,
const T1& t1,
const T2& t2) {
584 msg(LogMessage(level, IString(str, t0, t1, t2)));
587 template<
class T0,
class T1,
class T2,
class T3>
589 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3) {
590 msg(LogMessage(level, IString(str, t0, t1, t2, t3)));
593 template<
class T0,
class T1,
class T2,
class T3,
class T4>
595 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
597 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4)));
600 template<
class T0,
class T1,
class T2,
class T3,
class T4,
603 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
604 const T4& t4,
const T5& t5) {
605 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4, t5)));
608 template<
class T0,
class T1,
class T2,
class T3,
class T4,
611 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
612 const T4& t4,
const T5& t5,
const T6& t6) {
613 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4, t5, t6)));
616 template<
class T0,
class T1,
class T2,
class T3,
class T4,
617 class T5,
class T6,
class T7>
619 const T0& t0,
const T1& t1,
const T2& t2,
const T3& t3,
620 const T4& t4,
const T5& t5,
const T6& t6,
const T7& t7) {
621 msg(LogMessage(level, IString(str, t0, t1, t2, t3, t4, t5, t6, t7)));
638 Logger(
const Logger& unique);
644 void operator=(
const Logger& unique);
651 std::string getDomain();
660 void log(
const LogMessage& message);
669 std::string context_id;
671 LoggerContext context;
673 LoggerContext& getContext(
void);
677 #define rootLoggerMagic (0xF6569201)
678 static Logger *rootLogger;
679 static std::map<std::string,LogLevel>* defaultThresholds;
680 static unsigned int rootLoggerMark;
687 #define rootLogger getRootLogger()
689 #define LOG(LGR, THR, FSTR, ...) { if ((LGR).getThreshold() >= (THR)(LGR).msg((THR), (FSTR), ...); }
691 #endif // __ARC_LOGGER__