FixedContextCategory.cpp
Go to the documentation of this file.
1 /*
2  * FixedContextCategory.cpp
3  *
4  * Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5  * Copyright 2001, Bastiaan Bakker. All rights reserved.
6  *
7  * See the COPYING file for the terms of usage and distribution.
8  */
9 
10 #include "PortabilityImpl.hh"
12 
13 namespace log4cpp {
14 
16  const std::string& context) :
17  Category(name, Category::getInstance(name).getParent()),
18  _delegate(Category::getInstance(name)),
19  _context(context) {
20  }
21 
23  }
24 
25  void FixedContextCategory::setContext(const std::string& context) {
26  _context = context;
27  }
28 
29  std::string FixedContextCategory::getContext() const {
30  return _context;
31  }
32 
34  return Category::getPriority();
35  }
36 
38  Priority::Value result = getPriority();
39 
40  if (result == Priority::NOTSET) {
41  result = _delegate.getChainedPriority();
42  }
43 
44  return result;
45  }
46 
47  void FixedContextCategory::addAppender(Appender* appender) throw() {
48  // XXX do nothing for now
49  }
50 
52  // XXX do nothing for now
53  }
54 
56  return _delegate.getAppender();
57  }
58 
59  Appender* FixedContextCategory::getAppender(const std::string& name)
60  const {
61  return _delegate.getAppender(name);
62  }
63 
65  return _delegate.getAllAppenders();
66  }
67 
69  // XXX do nothing for now
70  }
71 
72  bool FixedContextCategory::ownsAppender() const throw() {
73  return false;
74  }
75 
76  bool FixedContextCategory::ownsAppender(Appender* appender) const throw() {
77  return false;
78  }
79 
81  throw() {
82  _delegate.callAppenders(event);
83  }
84 
85  void FixedContextCategory::setAdditivity(bool additivity) {
86  // XXX do nothing for now
87  }
88 
89  bool FixedContextCategory::getAdditivity() const throw() {
90  return _delegate.getAdditivity();
91  }
92 
94  const std::string& message) throw() {
95  LoggingEvent event(getName(), message, _context, priority);
96  callAppenders(event);
97  }
98 
99 }
100 
virtual void callAppenders(const LoggingEvent &event)
Definition: Category.cpp:220
virtual AppenderSet getAllAppenders() const
Definition: Category.cpp:144
virtual AppenderSet getAllAppenders() const
virtual void addAppender(Appender *appender)
virtual void callAppenders(const LoggingEvent &event)
virtual Appender * getAppender() const
Definition: Category.cpp:122
virtual Priority::Value getChainedPriority() const
Definition: Category.cpp:83
virtual void _logUnconditionally2(Priority::Value priority, const std::string &message)
FixedContextCategory(const std::string &name, const std::string &context="")
virtual Priority::Value getPriority() const
virtual void setAdditivity(bool additivity)
virtual const std::string & getName() const
Definition: Category.cpp:63
std::set< Appender * > AppenderSet
Definition: Appender.hh:147
virtual bool getAdditivity() const
Definition: Category.cpp:239
virtual Priority::Value getPriority() const
Definition: Category.cpp:67
virtual void setContext(const std::string &context)
virtual Appender * getAppender() const
virtual Priority::Value getChainedPriority() const
virtual std::string getContext() const


log4cpp
Author(s): Stephen Roderick, Bastiaan Bakker, Cedric Le Goater, Steve Ostlind, Marcel Harkema, Walter Stroebel, Glenn Scott and Tony Cheung
autogenerated on Sun Jun 23 2019 19:10:00