43 | | |
44 | | //! base class for all log_levels |
45 | | //! |
46 | | //! the existence of this class is forced by the necessity of passing log_levels to user_info methods, however, the main functionality |
47 | | //! is located in \c log_level_template class |
48 | | class log_level_base { |
49 | | private: |
50 | | // UserInfo class have to be able to read all the internal |
51 | | // attributes to be able to write/read log_level to/from a Setting structure |
52 | | friend class UI; |
53 | | |
54 | | //! this is necessary to allow logger to set ids vector appropriately and also to set registered_logger |
55 | | friend class logger; |
56 | | |
57 | | protected: |
58 | | //! boolean flags related indicating which details will be logged to a logger |
59 | | bitset<32> values; |
60 | | |
61 | | //! vector of vectors of log IDs - one element for each entry and multiple entries can be stored on the position of one enum |
62 | | Vec<ivec> ids; |
63 | | |
64 | | //! internal pointer to the logger to which this log_level is registered |
65 | | //! |
66 | | //! it is set to NULL at the beginning |
67 | | logger * registered_logger; |
68 | | |
69 | | public: |
70 | | //! default constructor |
71 | | log_level_base() { |
72 | | registered_logger = NULL; |
73 | | } |
74 | | |
75 | | |
76 | | //! a general utility transforming a comma-separated sequence of strings into an instance of Array<strings> |
77 | | static Array<string> string2Array( const string &input ); |
78 | | |
79 | | //! string equivalents of the used enumerations which are filled with a help of #LOG_LEVEL macro within class T |
80 | | virtual const Array<string> &names() const = 0; |
81 | | }; |