Luiza  v03-01
prefix.h
1 // -*- mode: c++;
2 #ifndef prefix_h
3 #define prefix_h
4 
5 #include <sstream>
6 
7 namespace streamlog{
8 
9  class logscope ;
10  class logstream ;
11 
12 
19  class prefix_base{
20 
21  friend class logscope ;
22  friend class logstream ;
23 
24  protected:
25  std::string _name ;
26  std::string _levelName ;
27 
28  public:
29  prefix_base() ;
30  virtual ~prefix_base() ;
31 
32  virtual std::string operator()() =0 ;
33 
34  void setLevelName( const std::string& lName) { _levelName = lName ; }
35 
36  };
37 
44  class prefix : public prefix_base{
45  public:
46  virtual std::string operator()() {
47  std::stringstream ss ;
48  ss << "[ " << this->_levelName << " \"" << this->_name << "\"] " ;
49  return ss.str() ;
50  }
51 
52  };
53 
54 
55 
56 }
57 #endif
Definition: prefix.h:44
Definition: logscope.h:23
Namespace of method for logging messages based on streamlog.
Definition: baselevels.h:20
Definition: prefix.h:19
Definition: logstream.h:52