Index: library/bdm/base/user_info.h
===================================================================
--- library/bdm/base/user_info.h (revision 952)
+++ library/bdm/base/user_info.h (revision 959)
@@ -319,9 +319,5 @@
 	//! method is necessary here to avoid the default call of "const SettingResolver link ( element );", 
 	//! which would lead to erroneous behaviour in this case
-// 	template<class T> static void from_setting ( log_level_base<T> &log_level, const Setting &element ) {
-// 		assert_type( element, Setting::TypeString );
-// 		call_from_setting( log_level, element );
-// 	}
-
+ 	static void from_setting ( log_level_base &log_level, const Setting &element );
 	//! This method converts a Setting into a dynamically allocated root descendant
 	template<class T> static void from_setting ( T* &instance, const Setting &element ) {
@@ -575,15 +571,5 @@
 	// possible that more instances of log_level_base  (templated with different classes)
 	// can be stored in only one line in a configuration file
-	template<class T> static void save ( const log_level_base<T> &log_level, Setting &element ) {
-		assert_type ( element, Setting::TypeGroup );		
-		string name = "log_level";
-		
-		if( element.exists( name ) ) 
-			assert_type ( element[name], Setting::TypeString );
-		else
-			element.add ( name, Setting::TypeString ); 
-
-		log_level.to_setting( element[name] );
-	}
+	static void save ( const log_level_base &log_level, Setting &element );
 
 	//!@}
Index: library/bdm/base/bdmbase.h
===================================================================
--- library/bdm/base/bdmbase.h (revision 956)
+++ library/bdm/base/bdmbase.h (revision 959)
@@ -296,4 +296,85 @@
 RV concat ( const RV &rv1, const RV &rv2 );
 
+
+
+//! This class stores a details that will be logged to a logger
+//!
+//! This is only the first part of the whole declaration, which has to be however separated into
+//! two different classes for allowing the compilation of source code. For more details
+//! see logger::add_setting(...) method and mainly log_level_template<T>::template<class U> void store( const enum T::log_level_enums log_level_enum, const U data ) const
+//! method. For the reason the second one is templated, it was necessary to declare this whole class. 
+template<class T> class log_level_intermediate : public log_level_base {
+protected:
+	//! boolean flags related indicating which details will be logged to a logger
+	bitset<32> values;
+
+	//! default constructor is protected to prevent creating instances elsewhere than in log_level_template descendant class
+	log_level_intermediate( ) {
+		int len = names().length();
+		ids.set_size( len );
+		for( int i = 0; i<len; i++ )
+		{
+			ids(i).set_size ( 1 );
+			ids(i) = -1;
+		}	
+	}
+public:
+	//! a general utility transforming a comma-separated sequence of strings into an instance of Array<strings>
+	static Array<string> string2Array( const string &input )
+	{
+		string result = input;
+		string::size_type loc;
+		while( loc = result.find( ',' ), loc != string::npos )
+			result[loc] = ' ';
+		return Array<string>("{ " + result + " }" );
+	} 
+
+	//! this method adds new id to its proper position and return the name of this position
+	string store_id_and_give_name( enum T::log_level_enums const log_level_enum,  int enum_subindex, int id ) {
+		if( ids(log_level_enum).length() <= enum_subindex )
+			ids(log_level_enum).set_size( enum_subindex+1, true );
+		ids(log_level_enum)(enum_subindex) = id; 
+
+		// here we remove a "log" prefix from name, i.e., for instance it transforms "logevidence" to "evidence"
+		ostringstream stream;
+		string name_with_prefix = names()(log_level_enum);
+		string possible_log_prefix = name_with_prefix.substr(0,3);
+		if( possible_log_prefix == "log" )
+			stream << name_with_prefix.substr(3,name_with_prefix.length()-3);
+		else 
+			stream << name_with_prefix;
+
+		// add number to name only in the case there are more registered vectors with the same log_level_enum
+		if( ids(log_level_enum).length() > 1 )
+			stream << "_" << enum_subindex;
+		
+		return stream.str();
+	}
+
+	//! string equivalents of the used enumerations which are filled with a help of #LOG_LEVEL macro within class T
+	const Array<string> &names() const
+	{
+		return T::log_level_names();
+	}
+
+	//! read only operator for testing individual fields of log_level
+	//!
+	//! it is necessary to acces it with a proper enumeration type, thus this approach is type-safe
+	bool operator [] (const enum T::log_level_enums &log_level_enum ) const
+	{
+		return values[log_level_enum];
+	}
+
+	//! operator for setting an individual field of log_level 
+	//!
+	//! it is necessary to acces it with a proper enumeration type, thus this approach is type-safe
+	bitset<32>::reference operator [] (const enum T::log_level_enums &log_level_enum )
+	{
+		return values[log_level_enum];
+	}
+};
+//UIREGISTER IS FORBIDDEN FOR THIS CLASS,  AS IT SHOULD BE LOADED ONLY THROUGH THE SPECIALIZED UI::GET(...) METHOD
+
+
 /*!
 @brief Class for storing results (and semi-results) of an experiment
@@ -351,5 +432,5 @@
 	//! 
 	//! passing the last parameter \c enum_subindex one can store multiple vectors in the position of one enum
-	template<class T> void add_vector ( log_level_base<T> &log_level, enum T::log_level_enums const log_level_enum, const RV &rv, const string &prefix, int enum_subindex = 0 )
+	template<class T> void add_vector ( log_level_intermediate<T> &log_level, enum T::log_level_enums const log_level_enum, const RV &rv, const string &prefix, int enum_subindex = 0 )
 	{
 		if( !log_level.registered_logger )
@@ -373,5 +454,5 @@
 	//! It also sets a pointer to logger or justify it is correctly assigned from previous call to this procedure 
 	//!
-	//! To allow both arguments log_level and log_level_enum be templated, it was necessary to declare log_level_base<T> class.
+	//! To allow both arguments log_level and log_level_enum be templated, it was necessary to declare log_level_intermediate<T> class.
 	//! This way we check compatibility of the passed log_level and log_level_enum, which would be impossible using just log_level_base class
 	//! here. 
@@ -379,5 +460,5 @@
 	//!
 	//! passing the last parameter \c enum_subindex one can store multiple settings in the position of one enum
-	template<class T> void add_setting ( log_level_base<T> &log_level, enum T::log_level_enums const log_level_enum,  const string &prefix, int enum_subindex = 0 ) {
+	template<class T> void add_setting ( log_level_intermediate<T> &log_level, enum T::log_level_enums const log_level_enum,  const string &prefix, int enum_subindex = 0 ) {
 		if( !log_level.registered_logger )
 			log_level.registered_logger = this;
@@ -405,26 +486,6 @@
 
 //! This class stores a details that will be logged to a logger
-template<class T> class log_level_template : public log_level_base<T> {
-protected:
-	//! boolean flags related indicating which details will be logged to a logger
-	bitset<32> values;
-
-public:
-
-	//! read only operator for testing individual fields of log_level
-	//!
-	//! it is necessary to acces it with a proper enumeration type, thus this approach is type-safe
-	bool operator [] (const enum T::log_level_enums &log_level_enum ) const
-	{
-		return values[log_level_enum];
-	}
-
-	//! operator for setting an individual field of log_level 
-	//!
-	//! it is necessary to acces it with a proper enumeration type, thus this approach is type-safe
-	bitset<32>::reference operator [] (const enum T::log_level_enums &log_level_enum )
-	{
-		return values[log_level_enum];
-	}
+template<class T> class log_level_template : public log_level_intermediate<T> {
+public:
 
 	//! Set log_levels according to the Setting element
@@ -512,5 +573,5 @@
   \ref ui
 */
-#define LOG_LEVEL(classname,...) public: enum log_level_enums { __VA_ARGS__ }; log_level_template<classname> log_level; private: friend class log_level_base<classname>; static const Array<string> &log_level_names() { static const Array<string> log_level_names = log_level_template<classname>::string2Array( #__VA_ARGS__ ); return log_level_names; }
+#define LOG_LEVEL(classname,...) public: enum log_level_enums { __VA_ARGS__ }; log_level_template<classname> log_level; private: friend class log_level_intermediate<classname>; static const Array<string> &log_level_names() { static const Array<string> log_level_names = log_level_template<classname>::string2Array( #__VA_ARGS__ ); return log_level_names; }
 
 
Index: library/bdm/base/user_info.cpp
===================================================================
--- library/bdm/base/user_info.cpp (revision 952)
+++ library/bdm/base/user_info.cpp (revision 959)
@@ -192,4 +192,16 @@
 
 	call_to_setting( instance, set );
+}
+
+void UI::save ( const log_level_base &log_level, Setting &element ) {
+	assert_type ( element, Setting::TypeGroup );		
+	string name = "log_level";
+		
+	if( element.exists( name ) ) 
+		assert_type ( element[name], Setting::TypeString );
+	else
+		element.add ( name, Setting::TypeString ); 
+	
+	call_to_setting( log_level, element[name] );
 }
 
@@ -286,19 +298,14 @@
 }
 
-	void UI::from_setting ( root &instance, const Setting &element ) {
-		if (element.getType()==Setting::TypeString){
-			const type_info *ti=&typeid(instance);
-			size_t strc=string(ti->name()).find("log_level_template");
-			if (strc!=string::npos){ // loglevel
-				call_from_setting( instance, element );
-			} else {
-				const SettingResolver link ( element );
-				assert_type( link.result, Setting::TypeGroup );
-				call_from_setting( instance, link.result);
-			}
-		}else{
-			call_from_setting( instance, element );
-		}
-	}
+void UI::from_setting ( log_level_base &log_level, const Setting &element ) {
+ 	assert_type( element, Setting::TypeString );
+ 	call_from_setting( log_level, element );
+}
+
+void UI::from_setting ( root &instance, const Setting &element ) {
+	const SettingResolver link ( element );
+	assert_type( link.result, Setting::TypeGroup );
+	call_from_setting( instance, link.result);
+}
 
 void UI::from_setting ( mat& matrix, const Setting &element ) {
