diff --git a/CMakeLists.txt b/CMakeLists.txt
index f106d8e2b0b549219533525581bcd75b35f697ed..3b1253bffb1b827039eae00440b18c07ed702633 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -107,7 +107,7 @@ set_target_properties(alarm_handler
     PROPERTIES 
         OUTPUT_NAME ${AH_NAME}
         LINK_FLAGS "-Wl,--no-undefined"
-        CXX_STANDARD 11)
+        CXX_STANDARD 17)
 
 if(DO_CLANG_TIDY)
     set_target_properties(alarm_handler 
diff --git a/src/AlarmHandler.cpp b/src/AlarmHandler.cpp
index 1add6214e3e25d787bf43e64dd59908e8f1b4c5f..274f4b5cd06127a060fbfbd9f8baf716b4079a2c 100644
--- a/src/AlarmHandler.cpp
+++ b/src/AlarmHandler.cpp
@@ -372,7 +372,7 @@ void AlarmHandler::init_device()
 	if(instanceCounter > 1)		
 	{
 		ERROR_STREAM << "More than one instance in the same executable of Alarm Server is not allowed!!" << endl;
-		cout << "ERROR: second instance of Alarm Server, exiting..." << endl;
+		TANGO_LOG << "ERROR: second instance of Alarm Server, exiting..." << endl;
 		exit(-1);
 	}	//-------------------------------------------	
 	alarmedlock = new(ReadersWritersLock);
@@ -524,7 +524,7 @@ void AlarmHandler::init_device()
 	} catch(string & e)
 	{
 		ERROR_STREAM << "AlarmHandler::init_device(): " << e << endl;
-		cout << "Error: " << e << ". Exiting..." << endl;
+		TANGO_LOG << "Error: " << e << ". Exiting..." << endl;
 		exit(-4);
 	}		
 	
@@ -3469,7 +3469,7 @@ void AlarmHandler::add_alarm(alarm_t& a, bool starting)
 	}
 
 }
-void AlarmHandler::add_event(alarm_t& a, vector<string> &evn) throw(string&)
+void AlarmHandler::add_event(alarm_t& a, vector<string> &evn)
 {
 	DEBUG_STREAM << "AlarmHandler::add_event(): formula '" << a.formula << "' found " << evn.size() << " events" << endl;
 	/*
@@ -4217,7 +4217,7 @@ void AlarmHandler::timer_update()
 	}
 }
 
-bool AlarmHandler::remove_alarm(string& s) throw(string&)
+bool AlarmHandler::remove_alarm(string& s)
 {
 	DEBUG_STREAM << "AlarmHandler::"<<__func__<<": entering alm name=" << s << endl;
 	alarms.vlock->writerIn();
@@ -4327,7 +4327,7 @@ bool AlarmHandler::remove_alarm(string& s) throw(string&)
 }  /* remove_alarm() */
 
 
-/*void AlarmHandler::add_to_database(alarm_t& a) throw(string&)
+/*void AlarmHandler::add_to_database(alarm_t& a)
 {
 	Tango::DbDatum alarm("alarm");
 	Tango::DbData db_data;
@@ -5359,7 +5359,7 @@ void AlarmHandler::eval_node_event(iter_t const& i, vector<string> & ev)
         std::transform(s.begin(), s.end(), s.begin(), (int(*)(int))tolower);		//transform to lowercase
 		ev.push_back(s);
     }
-    //cout << endl;
+    //TANGO_LOG << endl;
     //iter_t it = i->children.begin();
     for(iter_t it = i->children.begin(); it != i->children.end(); it++)
     	eval_node_event(it, ev);
@@ -5478,7 +5478,7 @@ void AlarmHandler::prepare_alarm_attr()
 
 		if(almstate == "OOSRV" || almstate == "SHLVD")
 		{
-			//cout << __func__ << ": " << ai->first << " silenced="<< ai->second.silenced << endl;
+			//TANGO_LOG << __func__ << ": " << ai->first << " silenced="<< ai->second.silenced << endl;
 #if 0
 			alm_disabled << KEY(ALARM_TIME_KEY) << time_buf << "." << ai->second.ts.tv_usec << SEP;
 			alm_disabled << KEY(NAME_KEY) << ai->first << SEP;
@@ -5614,7 +5614,7 @@ void AlarmHandler::prepare_alarm_attr()
 				 * found, change stat only if switching from
 				 * S_NORMAL or S_ALARM status to S_ERROR
 				 */
-				//cout << "read_attr(): S_ERROR: found: " << aid->name << endl;
+				//TANGO_LOG << "read_attr(): S_ERROR: found: " << aid->name << endl;
 				if (aid->stat != S_ERROR) {
 					aid->stat = S_ERROR;
 					aid->ack = NOT_ACK;
@@ -5665,7 +5665,7 @@ void AlarmHandler::prepare_alarm_attr()
 				 * found, change stat only if switching from
 				 * S_NORMAL to S_ALARM status
 				 */
-				//cout << "read_attr(): S_ALARM: found: " << aid->name << endl;
+				//TANGO_LOG << "read_attr(): S_ALARM: found: " << aid->name << endl;
 				if (aid->stat == S_NORMAL || aid->stat == S_ERROR) {
 					aid->stat = S_ALARM;
 					aid->ack = NOT_ACK;
diff --git a/src/AlarmHandler.h b/src/AlarmHandler.h
index f9827b45cd3f5e2ba99c9ee6303f6ab7922aa9a1..1f0fe2e80cc8152fd09e99e2842a7de2cf20acd7 100644
--- a/src/AlarmHandler.h
+++ b/src/AlarmHandler.h
@@ -33,7 +33,7 @@
 #ifndef AlarmHandler_H
 #define AlarmHandler_H
 
-#include <tango.h>
+#include <tango/tango.h>
 
 #include <boost/version.hpp>
 #if BOOST_VERSION  >= 103600
@@ -61,7 +61,15 @@ class update_thread;
 #	define	ELAPSED(before, after)	\
 		1000.0*(after.tv_sec-before.tv_sec) + \
 		((double)after.tv_usec-before.tv_usec) / 1000
-
+#ifndef TANGO_LOG
+#define TANGO_LOG cout
+#endif
+#ifndef TANGO_LOG_INFO
+#define TANGO_LOG_INFO cout2
+#endif
+#ifndef TANGO_LOG_DEBUG
+#define TANGO_LOG_DEBUG cout4
+#endif
 
 
 /*----- PROTECTED REGION END -----*/	//	AlarmHandler.h
@@ -585,13 +593,13 @@ private:
 	void init_alarms(map< string,vector<string> > &alarm_events);
 #endif
 	void add_alarm(alarm_t& a, bool starting=false);
-	void add_event(alarm_t& a, vector<string> &evn) throw(string&);
+	void add_event(alarm_t& a, vector<string> &evn);
 #if 0
-	void subscribe_event(alarm_t& a, EventCallBack& ecb, vector<string> &evn) throw(string&);
+	void subscribe_event(alarm_t& a, EventCallBack& ecb, vector<string> &evn);
 #endif
 //	void do_alarm(bei_t& e);											//gcc 4 problem??
-	bool remove_alarm(string& s) throw(string&);
-	//void add_to_database(alarm_t& a) throw(string&);
+	bool remove_alarm(string& s);
+	//void add_to_database(alarm_t& a);
 	void set_internal_alarm(string name, Tango::TimeVal t, string msg, unsigned int count=1);
 	
 	void load_alarm(string alarm_string, alarm_t &alm, vector<string> &evn);
diff --git a/src/AlarmHandlerClass.cpp b/src/AlarmHandlerClass.cpp
index 12694d4e25e510b74275e126a3fe70ee12e9782e..945b3307fb7e5cc0b15e65e8c878f04931dc0c69 100644
--- a/src/AlarmHandlerClass.cpp
+++ b/src/AlarmHandlerClass.cpp
@@ -73,7 +73,7 @@ AlarmHandlerClass *AlarmHandlerClass::_instance = NULL;
 //--------------------------------------------------------
 AlarmHandlerClass::AlarmHandlerClass(string &s):Tango::DeviceClass(s)
 {
-	cout2 << "Entering AlarmHandlerClass constructor" << endl;
+	TANGO_LOG_INFO << "Entering AlarmHandlerClass constructor" << endl;
 	set_default_property();
 	get_class_property();
 	write_class_property();
@@ -82,7 +82,7 @@ AlarmHandlerClass::AlarmHandlerClass(string &s):Tango::DeviceClass(s)
 	
 	/*----- PROTECTED REGION END -----*/	//	AlarmHandlerClass::constructor
 
-	cout2 << "Leaving AlarmHandlerClass constructor" << endl;
+	TANGO_LOG_INFO << "Leaving AlarmHandlerClass constructor" << endl;
 }
 
 //--------------------------------------------------------
@@ -162,7 +162,7 @@ AlarmHandlerClass *AlarmHandlerClass::instance()
 //--------------------------------------------------------
 CORBA::Any *AckClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "AckClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "AckClass::execute(): arrived" << endl;
 	const Tango::DevVarStringArray *argin;
 	extract(in_any, argin);
 	((static_cast<AlarmHandler *>(device))->ack(argin));
@@ -182,7 +182,7 @@ CORBA::Any *AckClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_an
 //--------------------------------------------------------
 CORBA::Any *LoadClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "LoadClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "LoadClass::execute(): arrived" << endl;
 	Tango::DevString argin;
 	extract(in_any, argin);
 	((static_cast<AlarmHandler *>(device))->load(argin));
@@ -202,7 +202,7 @@ CORBA::Any *LoadClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_a
 //--------------------------------------------------------
 CORBA::Any *RemoveClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "RemoveClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "RemoveClass::execute(): arrived" << endl;
 	Tango::DevString argin;
 	extract(in_any, argin);
 	((static_cast<AlarmHandler *>(device))->remove(argin));
@@ -222,7 +222,7 @@ CORBA::Any *RemoveClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in
 //--------------------------------------------------------
 CORBA::Any *SearchAlarmClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "SearchAlarmClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "SearchAlarmClass::execute(): arrived" << endl;
 	Tango::DevString argin;
 	extract(in_any, argin);
 	return insert((static_cast<AlarmHandler *>(device))->search_alarm(argin));
@@ -241,7 +241,7 @@ CORBA::Any *SearchAlarmClass::execute(Tango::DeviceImpl *device, const CORBA::An
 //--------------------------------------------------------
 CORBA::Any *StopAudibleClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any))
 {
-	cout2 << "StopAudibleClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "StopAudibleClass::execute(): arrived" << endl;
 	((static_cast<AlarmHandler *>(device))->stop_audible());
 	return new CORBA::Any();
 }
@@ -259,7 +259,7 @@ CORBA::Any *StopAudibleClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(co
 //--------------------------------------------------------
 CORBA::Any *SilenceClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "SilenceClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "SilenceClass::execute(): arrived" << endl;
 	const Tango::DevVarStringArray *argin;
 	extract(in_any, argin);
 	((static_cast<AlarmHandler *>(device))->silence(argin));
@@ -279,7 +279,7 @@ CORBA::Any *SilenceClass::execute(Tango::DeviceImpl *device, const CORBA::Any &i
 //--------------------------------------------------------
 CORBA::Any *ModifyClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "ModifyClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "ModifyClass::execute(): arrived" << endl;
 	Tango::DevString argin;
 	extract(in_any, argin);
 	((static_cast<AlarmHandler *>(device))->modify(argin));
@@ -299,7 +299,7 @@ CORBA::Any *ModifyClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in
 //--------------------------------------------------------
 CORBA::Any *ShelveClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "ShelveClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "ShelveClass::execute(): arrived" << endl;
 	const Tango::DevVarStringArray *argin;
 	extract(in_any, argin);
 	((static_cast<AlarmHandler *>(device))->shelve(argin));
@@ -319,7 +319,7 @@ CORBA::Any *ShelveClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in
 //--------------------------------------------------------
 CORBA::Any *EnableClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "EnableClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "EnableClass::execute(): arrived" << endl;
 	Tango::DevString argin;
 	extract(in_any, argin);
 	((static_cast<AlarmHandler *>(device))->enable(argin));
@@ -339,7 +339,7 @@ CORBA::Any *EnableClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in
 //--------------------------------------------------------
 CORBA::Any *DisableClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "DisableClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "DisableClass::execute(): arrived" << endl;
 	Tango::DevString argin;
 	extract(in_any, argin);
 	((static_cast<AlarmHandler *>(device))->disable(argin));
@@ -359,7 +359,7 @@ CORBA::Any *DisableClass::execute(Tango::DeviceImpl *device, const CORBA::Any &i
 //--------------------------------------------------------
 CORBA::Any *ResetStatisticsClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any))
 {
-	cout2 << "ResetStatisticsClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "ResetStatisticsClass::execute(): arrived" << endl;
 	((static_cast<AlarmHandler *>(device))->reset_statistics());
 	return new CORBA::Any();
 }
@@ -377,7 +377,7 @@ CORBA::Any *ResetStatisticsClass::execute(Tango::DeviceImpl *device, TANGO_UNUSE
 //--------------------------------------------------------
 CORBA::Any *StopNewClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any))
 {
-	cout2 << "StopNewClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "StopNewClass::execute(): arrived" << endl;
 	((static_cast<AlarmHandler *>(device))->stop_new());
 	return new CORBA::Any();
 }
@@ -395,7 +395,7 @@ CORBA::Any *StopNewClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const
 //--------------------------------------------------------
 CORBA::Any *GetAlarmInfoClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "GetAlarmInfoClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "GetAlarmInfoClass::execute(): arrived" << endl;
 	const Tango::DevVarStringArray *argin;
 	extract(in_any, argin);
 	return insert((static_cast<AlarmHandler *>(device))->get_alarm_info(argin));
@@ -414,7 +414,7 @@ CORBA::Any *GetAlarmInfoClass::execute(Tango::DeviceImpl *device, const CORBA::A
 //--------------------------------------------------------
 CORBA::Any *ReLoadAllClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any))
 {
-	cout2 << "ReLoadAllClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "ReLoadAllClass::execute(): arrived" << endl;
 	((static_cast<AlarmHandler *>(device))->re_load_all());
 	return new CORBA::Any();
 }
@@ -784,7 +784,7 @@ void AlarmHandlerClass::device_factory(const Tango::DevVarStringArray *devlist_p
 	//	Create devices and add it into the device list
 	for (unsigned long i=0 ; i<devlist_ptr->length() ; i++)
 	{
-		cout4 << "Device name : " << (*devlist_ptr)[i].in() << endl;
+		TANGO_LOG_DEBUG << "Device name : " << (*devlist_ptr)[i].in() << endl;
 		device_list.push_back(new AlarmHandler(this, (*devlist_ptr)[i]));
 	}
 
@@ -1432,7 +1432,7 @@ void AlarmHandlerClass::create_static_attribute_list(vector<Tango::Attr *> &att_
 		defaultAttList.push_back(att_name);
 	}
 
-	cout2 << defaultAttList.size() << " attributes in default list" << endl;
+	TANGO_LOG_INFO << defaultAttList.size() << " attributes in default list" << endl;
 
 	/*----- PROTECTED REGION ID(AlarmHandlerClass::create_static_att_list) ENABLED START -----*/
 	
@@ -1468,7 +1468,7 @@ void AlarmHandlerClass::erase_dynamic_attributes(const Tango::DevVarStringArray
 			vector<string>::iterator ite_str = find(defaultAttList.begin(), defaultAttList.end(), att_name);
 			if (ite_str == defaultAttList.end())
 			{
-				cout2 << att_name << " is a UNWANTED dynamic attribute for device " << (*devlist_ptr)[i] << endl;
+				TANGO_LOG_INFO << att_name << " is a UNWANTED dynamic attribute for device " << (*devlist_ptr)[i] << endl;
 				Tango::Attribute &att = dev->get_device_attr()->get_attr_by_name(att_name.c_str());
 				dev->remove_attribute(att_list[att.get_attr_idx()], true, false);
 				--ite_att;
diff --git a/src/AlarmHandlerClass.h b/src/AlarmHandlerClass.h
index 7a0925cc5acdc9b303d6623abad3314a03a77a24..4735716c543cc4afb1f0bf2d3e0da4e96a14811e 100644
--- a/src/AlarmHandlerClass.h
+++ b/src/AlarmHandlerClass.h
@@ -37,7 +37,7 @@
 #ifndef AlarmHandlerClass_H
 #define AlarmHandlerClass_H
 
-#include <tango.h>
+#include <tango/tango.h>
 #include <AlarmHandler.h>
 
 
diff --git a/src/ClassFactory.cpp b/src/ClassFactory.cpp
index a8478163ce0f965d4b12b2bdcecf9790dc962422..fb181eefd2e86220ce3de786ca107766bcea3b8e 100644
--- a/src/ClassFactory.cpp
+++ b/src/ClassFactory.cpp
@@ -32,7 +32,7 @@
 //        (Program Obviously used to Generate tango Object)
 //=============================================================================
 
-#include <tango.h>
+#include <tango/tango.h>
 #include <AlarmHandlerClass.h>
 
 //	Add class header files if needed
diff --git a/src/SubscribeThread.h b/src/SubscribeThread.h
index 191ac9841974e4a16870bffa795af0ee1f530935..2bb1caf6b3a6fec2c9d30c19c9e57cc08b169dae 100644
--- a/src/SubscribeThread.h
+++ b/src/SubscribeThread.h
@@ -1,8 +1,7 @@
 #ifndef _SUBSCRIBE_THREAD_H
 #define _SUBSCRIBE_THREAD_H
 
-#include <tango.h>
-#include <eventconsumer.h>
+#include <tango/tango.h>
 #include <stdint.h>
 #include "event_table.h"
 
diff --git a/src/alarm-thread.cpp b/src/alarm-thread.cpp
index cb5d5951f9ee3346a7a7c4e38d2914a2b131dbf5..9a9874420fdf7d6f48c13f4feece634bd5f4b92e 100644
--- a/src/alarm-thread.cpp
+++ b/src/alarm-thread.cpp
@@ -14,7 +14,7 @@ static const char __FILE__rev[] = __FILE__ " $Revision: 1.7 $";
  */
 alarm_thread::alarm_thread(AlarmHandler_ns::AlarmHandler *p) : p_Alarm(p)
 {
-	//cout << __FILE__rev << endl;
+	//TANGO_LOG << __FILE__rev << endl;
 }
 
 /*
@@ -136,5 +136,5 @@ void alarm_thread::run(void *)
 			printf("alarm_thread::run(): catched unknown exception!!");
 		}		
 	}
-	//cout << "alarm_thread::run(): returning" << endl;
+	//TANGO_LOG << "alarm_thread::run(): returning" << endl;
 }  /* alarm_thread::run() */
diff --git a/src/alarm-thread.h b/src/alarm-thread.h
index 721c4a75fd3ff400da33f1b1c000739288b82d83..a5b7ccc21e61c53100840422cae158611d49fb1c 100644
--- a/src/alarm-thread.h
+++ b/src/alarm-thread.h
@@ -10,7 +10,7 @@
 #define ALARM_THREAD_H
 
 #include <omnithread.h>
-#include <tango.h>
+#include <tango/tango.h>
 #include <AlarmHandler.h>
 
 #define ALARM_THREAD_EXIT				"alarm_thread_exit"
diff --git a/src/alarm_table.cpp b/src/alarm_table.cpp
index 9ca66f8418e388b79015a8490b925c5387934c5c..1783cdaa8c6ffee21f6b29da5e990c23d5b112f5 100644
--- a/src/alarm_table.cpp
+++ b/src/alarm_table.cpp
@@ -7,7 +7,7 @@
  */
 
 #include <sys/time.h>
-#include <tango.h>
+#include <tango/tango.h>
 #include "alarm_table.h"
 #include "alarm_grammar.h"
 #include "cmd_thread.h"
@@ -940,7 +940,7 @@ void alarm_table::save_alarm_conf_db(const string &att_name, const string &name,
 	}
 	catch(Tango::DevFailed &e)
 	{
-		cout << __func__ << ": Exception saving configuration = " << e.errors[0].desc<<endl;
+		TANGO_LOG << __func__ << ": Exception saving configuration = " << e.errors[0].desc<<endl;
 	}
 }
 
@@ -988,7 +988,7 @@ void alarm_table::delete_alarm_conf_db(string att_name)
 	}
 	catch(Tango::DevFailed &e)
 	{
-		cout << __func__ << ": Exception deleting " << att_name << " = " << e.errors[0].desc<<endl;
+		TANGO_LOG << __func__ << ": Exception deleting " << att_name << " = " << e.errors[0].desc<<endl;
 	}
 }
 
@@ -1012,7 +1012,7 @@ void alarm_table::get_alarm_list_db(vector<string> &al_list, map<string, string>
 	}
 	catch(Tango::DevFailed &e)
 	{
-		cout << __func__ << ": Exception reading configuration = " << e.errors[0].desc<<endl;
+		TANGO_LOG << __func__ << ": Exception reading configuration = " << e.errors[0].desc<<endl;
 	}
 	savedlock->writerIn();
 	saved_alarms.clear();
@@ -1067,7 +1067,7 @@ void alarm_table::get_alarm_list_db(vector<string> &al_list, map<string, string>
 				db_data[i] >> alm_receivers;
 			else
 			{
-				cout << "att_name="<<att_name<<" UNKWNOWN prop_name="<<prop_name<<endl;
+				TANGO_LOG << "att_name="<<att_name<<" UNKWNOWN prop_name="<<prop_name<<endl;
 				i++;
 				continue;
 			}
@@ -1092,7 +1092,7 @@ void alarm_table::get_alarm_list_db(vector<string> &al_list, map<string, string>
 				KEY(ENABLED_KEY)<< alm_enabled;
 		if(alm_name.empty() || alm_formula.empty() || alm_level.empty() || alm_group.empty() || alm_message.empty()) //TODO: decide if all mandatory
 		{
-			cout << __func__ << ": skipped '" << alm.str() << "'" << endl;
+			TANGO_LOG << __func__ << ": skipped '" << alm.str() << "'" << endl;
 			continue;
 		}
 		al_list.push_back(alm.str());
diff --git a/src/alarm_table.h b/src/alarm_table.h
index 321b8e3ac7f47b0a3e6cd2c051985b8626eea68e..8155101a0710e39a645ae3d81b77fdc61a46ca86 100644
--- a/src/alarm_table.h
+++ b/src/alarm_table.h
@@ -15,7 +15,7 @@
 #include <string>
 #include <map>
 
-#include <tango.h>
+#include <tango/tango.h>
 
 //spirit defines have to be put befor first inclusion of spirit headers
 #ifndef BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT
@@ -45,7 +45,7 @@
 
 //#include "log_thread.h"
 
-#define LOG_STREAM		cout
+#define LOG_STREAM		TANGO_LOG
 
 using namespace std;
 
@@ -102,10 +102,10 @@ struct rwlock_t
 	rwlock_t(string n){name=n;};
 	rwlock_t(){name=string("RWLOCK");};
 	boost::shared_mutex mut;
-	void readerIn(){cout<<name<<": " << __func__<<endl;mut.lock_shared();}
-	void readerOut(){cout<<name<<": " << __func__<<endl;mut.unlock_shared();}
-	void writerIn(){cout<<name<<": " << __func__<<endl;mut.lock();}
-	void writerOut(){cout<<name<<": " << __func__<<endl;mut.unlock();}
+	void readerIn(){TANGO_LOG<<name<<": " << __func__<<endl;mut.lock_shared();}
+	void readerOut(){TANGO_LOG<<name<<": " << __func__<<endl;mut.unlock_shared();}
+	void writerIn(){TANGO_LOG<<name<<": " << __func__<<endl;mut.lock();}
+	void writerOut(){TANGO_LOG<<name<<": " << __func__<<endl;mut.unlock();}
 };
 #endif
 
diff --git a/src/cmd_thread.cpp b/src/cmd_thread.cpp
index 809f23318758ddbc0e2f45c2799f416c61e64d91..742603021e2a85fded68d5b11b53db77cd4b1128 100644
--- a/src/cmd_thread.cpp
+++ b/src/cmd_thread.cpp
@@ -14,8 +14,8 @@ static const char __FILE__rev[] = __FILE__ " $Revision: 1.3 $";
  */
 cmd_thread::cmd_thread() 
 {
-	cout << __FILE__rev << endl;
-	cout << gettime().tv_sec << " cmd_thread::cmd_thread(): constructor... !" << endl;	
+	TANGO_LOG << __FILE__rev << endl;
+	TANGO_LOG << gettime().tv_sec << " cmd_thread::cmd_thread(): constructor... !" << endl;	
 	//mutex_dp = new omni_mutex::omni_mutex();
 }
 
@@ -24,7 +24,7 @@ cmd_thread::cmd_thread()
  */
 cmd_thread::~cmd_thread()
 {
-	cout << gettime().tv_sec << " cmd_thread::~cmd_thread(): delete device entering..." << endl;
+	TANGO_LOG << gettime().tv_sec << " cmd_thread::~cmd_thread(): delete device entering..." << endl;
 	//delete mutex_dp;	
 }
 
@@ -44,13 +44,13 @@ void cmd_thread::run(void *)
 			switch(cmd.cmd_id)
 			{
 				case CMD_THREAD_EXIT:
-					cout << gettime().tv_sec << " cmd_thread::run(): received command THREAD_EXIT -> exiting..." << endl;				
+					TANGO_LOG << gettime().tv_sec << " cmd_thread::run(): received command THREAD_EXIT -> exiting..." << endl;				
 				return;
 				
 				case CMD_COMMAND:
 				{
 					try {
-						cout << gettime().tv_sec << " cmd_thread::run(): COMMAND ... action=" << cmd.arg_s3 << endl;
+						TANGO_LOG << gettime().tv_sec << " cmd_thread::run(): COMMAND ... action=" << cmd.arg_s3 << endl;
 						dp = (Tango::DeviceProxy *)cmd.dp_add;
 						if(cmd.arg_b)
 						{
@@ -64,7 +64,7 @@ void cmd_thread::run(void *)
 						}
 						else
 							call_id = dp->command_inout_asynch(cmd.arg_s2);
-						cout << gettime().tv_sec <<  " cmd_thread::run() executed action: " << cmd.arg_s3 << " !!! call_id=" << call_id << endl;
+						TANGO_LOG << gettime().tv_sec <<  " cmd_thread::run() executed action: " << cmd.arg_s3 << " !!! call_id=" << call_id << endl;
 						/*cmd_t arg;
 						arg.cmd_id = CMD_RESPONSE;
 						arg.call_id = call_id;
@@ -83,11 +83,11 @@ void cmd_thread::run(void *)
 						if(err.find("is not yet arrived") == string::npos)			//TODO: change this!!
 						{
 							out_stream << "Failed to execute action " << cmd.arg_s3 << ", err=" << e.errors[0].desc << ends;
-							cout << gettime().tv_sec <<  " cmd_thread::run() ERROR: " << out_stream.str() << endl;
+							TANGO_LOG << gettime().tv_sec <<  " cmd_thread::run() ERROR: " << out_stream.str() << endl;
 						}
 						else
 						{
-							cout << gettime().tv_sec <<  " cmd_thread::run() exception 'is not yet arrived': pushing request of response, call_id=" << call_id << endl;
+							TANGO_LOG << gettime().tv_sec <<  " cmd_thread::run() exception 'is not yet arrived': pushing request of response, call_id=" << call_id << endl;
 							cmd.cmd_id = CMD_RESPONSE;			//if no exception till now push in list request of response
 							cmd.call_id = call_id;				//if no exception till now push in list request of response
 							list.push_back(cmd);		//if no exception till now push in list request of response						
@@ -99,12 +99,12 @@ void cmd_thread::run(void *)
 				
 				case CMD_RESPONSE:
 				{
-					//cout << gettime().tv_sec << " cmd_thread::run(): RESPONSE WAKE UP... action=" << cmd.arg_s3 << " call_id=" << cmd.call_id << endl;
+					//TANGO_LOG << gettime().tv_sec << " cmd_thread::run(): RESPONSE WAKE UP... action=" << cmd.arg_s3 << " call_id=" << cmd.call_id << endl;
 					Tango::DeviceData resp;
 					dp = (Tango::DeviceProxy *)cmd.dp_add;
 					try {
 						resp = dp->command_inout_reply(cmd.call_id);
-						cout << gettime().tv_sec << " cmd_thread::run() RECEIVED response to action " << cmd.arg_s3 << endl;
+						TANGO_LOG << gettime().tv_sec << " cmd_thread::run() RECEIVED response to action " << cmd.arg_s3 << endl;
 					} catch(Tango::DevFailed &e)
 					{
 						TangoSys_MemStream out_stream;
@@ -118,7 +118,7 @@ void cmd_thread::run(void *)
 						}
 						else
 						{
-							cout << gettime().tv_sec << " cmd_thread::run() " <<  out_stream.str() << endl;
+							TANGO_LOG << gettime().tv_sec << " cmd_thread::run() " <<  out_stream.str() << endl;
 							Tango::Except::print_exception(e);
 						}
 					}				
@@ -127,19 +127,19 @@ void cmd_thread::run(void *)
 			}
 /*			if(cmd.arg_s == CMD_THREAD_EXIT)
 			{
-				cout << gettime().tv_sec << " cmd_thread::run(): received command THREAD_EXIT -> exiting..." << endl;				
+				TANGO_LOG << gettime().tv_sec << " cmd_thread::run(): received command THREAD_EXIT -> exiting..." << endl;				
 				return;
 			}
 			else
 			{
-				cout << gettime().tv_sec << " cmd_thread::run(): WAKE UP... action=" << cmd.arg_s << endl;
+				TANGO_LOG << gettime().tv_sec << " cmd_thread::run(): WAKE UP... action=" << cmd.arg_s << endl;
 				Tango::DeviceData resp;
 				dp = (Tango::DeviceProxy *)cmd.dp_add;
 				try {
 					mutex_dp->lock();
 					resp = dp->command_inout_reply(cmd.cmd_id);
 					mutex_dp->unlock();
-					cout << gettime().tv_sec << " cmd_thread::run() received response to action " << cmd.arg_s << endl;
+					TANGO_LOG << gettime().tv_sec << " cmd_thread::run() received response to action " << cmd.arg_s << endl;
 				} catch(Tango::DevFailed &e)
 				{
 					TangoSys_MemStream out_stream;
@@ -152,7 +152,7 @@ void cmd_thread::run(void *)
 						omni_thread::sleep(0,300000000);	//0.2 s
 					}
 					else
-						cout << gettime().tv_sec << " cmd_thread::run() " <<  out_stream.str() << endl;
+						TANGO_LOG << gettime().tv_sec << " cmd_thread::run() " <<  out_stream.str() << endl;
 				}
 			}*/
 			
@@ -178,7 +178,7 @@ void cmd_thread::run(void *)
 			printf("cmd_thread::run(): catched unknown exception!!");
 		}		
 	}
-	//cout << "alarm_thread::run(): returning" << endl;
+	//TANGO_LOG << "alarm_thread::run(): returning" << endl;
 }  /* cmd_thread::run() */
 
 /*
@@ -188,7 +188,7 @@ void cmd_list::push_back(cmd_t& cmd)
 {
 	this->lock();
 
-	//cout << "cmd_list::push_back: cmd_id=" << cmd.cmd_id << " call_id=" << cmd.call_id << endl;
+	//TANGO_LOG << "cmd_list::push_back: cmd_id=" << cmd.cmd_id << " call_id=" << cmd.call_id << endl;
 	try{
 		l_cmd.push_back(cmd);		
 		empty.signal();
@@ -255,7 +255,7 @@ const cmd_t cmd_list::pop_front(void)
 	/*const*/ cmd_t cmd;
 
 	cmd = *(l_cmd.begin());
-	//cout << "cmd_list::pop_front: " << e.name << " value=" << e.value[0] << endl;
+	//TANGO_LOG << "cmd_list::pop_front: " << e.name << " value=" << e.value[0] << endl;
 	l_cmd.pop_front();
 
 	this->unlock();
diff --git a/src/cmd_thread.h b/src/cmd_thread.h
index b9b32caa504624c04cee3a29753b95a5af1fee3a..4fbbf49d33b25d5da9db0a88e636ef84f385b2af 100644
--- a/src/cmd_thread.h
+++ b/src/cmd_thread.h
@@ -19,7 +19,7 @@
 #define CMD_THREAD_EXIT	3
 
 #include <omnithread.h>
-#include <tango.h>
+#include <tango/tango.h>
 #include "AlarmHandler.h"
 
 struct cmd_t
diff --git a/src/event_table.cpp b/src/event_table.cpp
index 315b62715987735a6172e7ce580bb87042816876..2a19323790c259bafcf4d3554e605ffce2fb07ee 100644
--- a/src/event_table.cpp
+++ b/src/event_table.cpp
@@ -7,13 +7,11 @@
  */
 
 #include <sys/time.h>
-#include <tango.h>
+#include <tango/tango.h>
 #include "event_table.h"
 #include "AlarmHandler.h"
 #include "alarm_grammar.h"
 
-//for get_event_system_for_event_id, to know if ZMQ
-#include <eventconsumer.h>
 #include <regex>
 
 static const char __FILE__rev[] = __FILE__ " $Revision: 1.5 $";
@@ -147,7 +145,7 @@ void alarm_list::pop(const string& a)
 	if(it != l_alarm.end())
 		l_alarm.erase(it);
 	else
-		cout << "alarm_list::"<<__func__<< ": ALARM '"<< a << "' NOT FOUND!"<< endl;	
+		TANGO_LOG << "alarm_list::"<<__func__<< ": ALARM '"<< a << "' NOT FOUND!"<< endl;	
 
 	l.unlock();
 	return;
@@ -387,7 +385,7 @@ void event_table::free_proxy(void)
 	}
 }
 
-void event_table::subscribe(EventCallBack& ecb) throw(vector<string> &)//throw(string&)
+void event_table::subscribe(EventCallBack& ecb)
 {
 	vector<string> subscribe_error;
 	if (v_event.empty() == false) {
@@ -411,7 +409,7 @@ void event_table::subscribe(EventCallBack& ecb) throw(vector<string> &)//throw(s
 		throw subscribe_error;
 }
 
-void event_table::unsubscribe(void) throw(string&)
+void event_table::unsubscribe(void)
 {
 	ostringstream o;
 	if (v_event.empty() == false) {
@@ -1264,7 +1262,7 @@ void EventCallBack::push_event(Tango::EventData* ev)
 	try {
 		//e.errors = ev->errors;
 		e.quality = Tango::ATTR_VALID;
-		//cout << "EVENT="<<ev->attr_name<<" quality="<<e.quality<<endl;
+		//TANGO_LOG << "EVENT="<<ev->attr_name<<" quality="<<e.quality<<endl;
 		if (!ev->err) {
 			e.quality = (int)ev->attr_value->get_quality();
 #if 0//TANGO_VER >= 711
diff --git a/src/event_table.h b/src/event_table.h
index 3c5980ee11e63ebf36fd7f5ca886026961981fa7..764369b3feed7d55fac9eff7f8d1a3e1fee08ad3 100644
--- a/src/event_table.h
+++ b/src/event_table.h
@@ -13,7 +13,7 @@
 #include <string>
 #include <map>
 #include <atomic>
-#include <tango.h>
+#include <tango/tango.h>
 
 
 using namespace std;
@@ -154,8 +154,8 @@ class event_table : public Tango::TangoMonitor, public Tango::LogAdapter {
 #if 0
 		void init_proxy(void)  throw(vector<string> &);
 		void free_proxy(void);
-		void subscribe(EventCallBack& ecb) throw(vector<string> &);//throw(string&);
-		void unsubscribe(void) throw(string&);
+		void subscribe(EventCallBack& ecb);
+		void unsubscribe(void);
 #endif
 		/**
 		 * Add a new signal.
diff --git a/src/main.cpp b/src/main.cpp
index 52ab468d4fd318e67b2e7fc11827ec48ace2629c..7ac168763dcd90523074f5ec89aa88079eb1acda 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -31,7 +31,7 @@
 //                This file is generated by POGO
 //        (Program Obviously used to Generate tango Object)
 //=============================================================================
-#include <tango.h>
+#include <tango/tango.h>
 
 // Check if crash reporting is used.
 #if defined(ENABLE_CRASH_REPORT)
@@ -43,8 +43,15 @@
 
 DECLARE_CRASH_HANDLER;
 
+#ifndef TANGO_LOG
+#define TANGO_LOG cout
+#endif
+
+
 int main(int argc,char *argv[])
 {
+    using std::endl;
+    using std::bad_alloc;
 	INSTALL_CRASH_HANDLER
 	try
 	{
@@ -59,20 +66,20 @@ int main(int argc,char *argv[])
 
 		// Run the endless loop
 		//----------------------------------------
-		cout << "Ready to accept request" << endl;
+		TANGO_LOG << "Ready to accept request" << endl;
 		tg->server_run();
 	}
 	catch (bad_alloc &)
 	{
-		cout << "Can't allocate memory to store device object !!!" << endl;
-		cout << "Exiting" << endl;
+		TANGO_LOG << "Can't allocate memory to store device object !!!" << endl;
+		TANGO_LOG << "Exiting" << endl;
 	}
 	catch (CORBA::Exception &e)
 	{
 		Tango::Except::print_exception(e);
 		
-		cout << "Received a CORBA_Exception" << endl;
-		cout << "Exiting" << endl;
+		TANGO_LOG << "Received a CORBA_Exception" << endl;
+		TANGO_LOG << "Exiting" << endl;
 	}
 	Tango::Util::instance()->server_cleanup();
 	return(0);
diff --git a/src/update-thread.cpp b/src/update-thread.cpp
index 6cac54898bb1e0bf00d587384981979ab72d9485..06ed89cabef9f2c851e428a2afd4bfb1eea082f3 100644
--- a/src/update-thread.cpp
+++ b/src/update-thread.cpp
@@ -10,7 +10,7 @@ static const char __FILE__rev[] = __FILE__ " $Revision: 1.2 $";
  */
 update_thread::update_thread(AlarmHandler_ns::AlarmHandler *p) : p_Alarm(p),Tango::LogAdapter(p)
 {
-	//cout << __FILE__rev << endl;
+	//TANGO_LOG << __FILE__rev << endl;
 }
 
 /*
diff --git a/src/update-thread.h b/src/update-thread.h
index 75ce00ef994038d2db64ebc39ca69c2623509941..59688d184993978227980d007401786959b926b4 100644
--- a/src/update-thread.h
+++ b/src/update-thread.h
@@ -6,7 +6,7 @@
 #define UPDATE_THREAD_H
 
 #include <omnithread.h>
-#include <tango.h>
+#include <tango/tango.h>
 #include <AlarmHandler.h>
 
 class update_thread : public omni_thread, public Tango::TangoMonitor, public Tango::LogAdapter {
diff --git a/test/testdevice/CMakeLists.txt b/test/testdevice/CMakeLists.txt
index 47e5ffd4c460fe7a55dda2e4881dea2d285f99e3..bfba52a7794848c53b7450e5f28ba676389656d3 100644
--- a/test/testdevice/CMakeLists.txt
+++ b/test/testdevice/CMakeLists.txt
@@ -80,7 +80,7 @@ set_target_properties(testdevice
     PROPERTIES 
         OUTPUT_NAME ${DEV_NAME}
         LINK_FLAGS "-Wl,--no-undefined"
-        CXX_STANDARD 11)
+        CXX_STANDARD 17)
 
 target_compile_options(testdevice 
     PRIVATE "$<$<CONFIG:DEBUG>:-g>")
diff --git a/test/testdevice/src/ClassFactory.cpp b/test/testdevice/src/ClassFactory.cpp
index 1b2363345f0d92536c352396be57afb84f8a387d..74f08f73aaa5e57938bc78c0eeb0998e6e4d348d 100644
--- a/test/testdevice/src/ClassFactory.cpp
+++ b/test/testdevice/src/ClassFactory.cpp
@@ -18,7 +18,7 @@
 //=============================================================================
 
 
-#include <tango.h>
+#include <tango/tango.h>
 #include <TestDeviceClass.h>
 
 //	Add class header files if needed
diff --git a/test/testdevice/src/TestDevice.cpp b/test/testdevice/src/TestDevice.cpp
index ab7a8fc151749b0bd127ea1bfa509b98f4ce3b23..75aed6101838768e61d3f0401fbf4250d2e09a81 100644
--- a/test/testdevice/src/TestDevice.cpp
+++ b/test/testdevice/src/TestDevice.cpp
@@ -1609,7 +1609,7 @@ void TestDevice::set_write_value(Tango::DevString value, string attrname)
 CORBA::Any *CmdClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any)
 {
 
-	cout << "CmdClass::" << get_name() << ": entering..." << endl;
+	TANGO_LOG << "CmdClass::" << get_name() << ": entering..." << endl;
 
 	//const Tango::DevVarLongArray	*argin;
 	//extract(in_any, argin);
diff --git a/test/testdevice/src/TestDevice.h b/test/testdevice/src/TestDevice.h
index d8b28e58ecb617e355ddae8a9fadd39aff563892..633650d3090f29cf658483fdf4e01429f471d6e6 100644
--- a/test/testdevice/src/TestDevice.h
+++ b/test/testdevice/src/TestDevice.h
@@ -18,11 +18,21 @@
 #define TestDevice_H
 
 
-#include <tango.h>
+#include <tango/tango.h>
 
 #define MAX_ATTR_SIZE 3000
 #define MAX_SPECTRUM_SIZE	100
 
+#ifndef TANGO_LOG
+#define TANGO_LOG cout
+#endif
+#ifndef TANGO_LOG_INFO
+#define TANGO_LOG_INFO cout2
+#endif
+#ifndef TANGO_LOG_DEBUG
+#define TANGO_LOG_DEBUG cout4
+#endif
+
 /*----- PROTECTED REGION END -----*/
 
 
@@ -34,6 +44,7 @@
 namespace TestDevice_ns
 {
 	/*----- PROTECTED REGION ID(TestDevice::Additional Class Declarations) ENABLED START -----*/
+    using namespace std;
 
 	//		Additional Class Declarations
 typedef struct {
@@ -53,7 +64,6 @@ enum { typeDouble, typeLong, typeBool, typeString, typeUchar};
 
 class TestDevice : public TANGO_BASE_CLASS
 {
-
 	friend class CmdClass;
 	/*----- PROTECTED REGION ID(TestDevice::Data Members) ENABLED START -----*/
 
diff --git a/test/testdevice/src/TestDeviceClass.cpp b/test/testdevice/src/TestDeviceClass.cpp
index c9390d9fe775908aaae8557402424ecbb980c1a2..eafabed73648eeca41cbf69b4dfd56c3b4c8130b 100644
--- a/test/testdevice/src/TestDeviceClass.cpp
+++ b/test/testdevice/src/TestDeviceClass.cpp
@@ -60,7 +60,7 @@ TestDeviceClass *TestDeviceClass::_instance = NULL;
 //--------------------------------------------------------
 TestDeviceClass::TestDeviceClass(string &s):DeviceClass(s)
 {
-	cout2 << "Entering TestDeviceClass constructor" << endl;
+	TANGO_LOG_INFO << "Entering TestDeviceClass constructor" << endl;
 	set_default_property();
 	get_class_property();
 	write_class_property();
@@ -69,7 +69,7 @@ TestDeviceClass::TestDeviceClass(string &s):DeviceClass(s)
 
 	/*----- PROTECTED REGION END -----*/	//	TestDevice::Class::constructor
 
-	cout2 << "Leaving TestDeviceClass constructor" << endl;
+	TANGO_LOG_INFO << "Leaving TestDeviceClass constructor" << endl;
 }
 
 
@@ -151,7 +151,7 @@ TestDeviceClass *TestDeviceClass::instance()
 //--------------------------------------------------------
 CORBA::Any *WriteAttrnameClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "WriteAttrnameClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "WriteAttrnameClass::execute(): arrived" << endl;
 
 	const Tango::DevVarDoubleStringArray	*argin;
 	extract(in_any, argin);
@@ -172,7 +172,7 @@ CORBA::Any *WriteAttrnameClass::execute(Tango::DeviceImpl *device, const CORBA::
 //--------------------------------------------------------
 CORBA::Any *ReadAttrnameClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "ReadAttrnameClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "ReadAttrnameClass::execute(): arrived" << endl;
 
 	const Tango::DevVarStringArray	*argin;
 	extract(in_any, argin);
@@ -192,7 +192,7 @@ CORBA::Any *ReadAttrnameClass::execute(Tango::DeviceImpl *device, const CORBA::A
 //--------------------------------------------------------
 CORBA::Any *ConfigClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "ConfigClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "ConfigClass::execute(): arrived" << endl;
 
 	const Tango::DevVarStringArray	*argin;
 	extract(in_any, argin);
@@ -213,7 +213,7 @@ CORBA::Any *ConfigClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in
 //--------------------------------------------------------
 CORBA::Any *AddClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "AddClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "AddClass::execute(): arrived" << endl;
 
 	const Tango::DevVarStringArray	*argin;
 	extract(in_any, argin);
@@ -234,7 +234,7 @@ CORBA::Any *AddClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_an
 //--------------------------------------------------------
 CORBA::Any *AddDoubleClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "AddDoubleClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "AddDoubleClass::execute(): arrived" << endl;
 
 	const Tango::DevVarStringArray	*argin;
 	extract(in_any, argin);
@@ -255,7 +255,7 @@ CORBA::Any *AddDoubleClass::execute(Tango::DeviceImpl *device, const CORBA::Any
 //--------------------------------------------------------
 CORBA::Any *AddLongClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "AddLongClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "AddLongClass::execute(): arrived" << endl;
 
 	const Tango::DevVarStringArray	*argin;
 	extract(in_any, argin);
@@ -276,7 +276,7 @@ CORBA::Any *AddLongClass::execute(Tango::DeviceImpl *device, const CORBA::Any &i
 //--------------------------------------------------------
 CORBA::Any *AddBoolClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "AddBoolClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "AddBoolClass::execute(): arrived" << endl;
 
 	const Tango::DevVarStringArray	*argin;
 	extract(in_any, argin);
@@ -297,7 +297,7 @@ CORBA::Any *AddBoolClass::execute(Tango::DeviceImpl *device, const CORBA::Any &i
 //--------------------------------------------------------
 CORBA::Any *AddStringClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "AddStringClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "AddStringClass::execute(): arrived" << endl;
 
 	const Tango::DevVarStringArray	*argin;
 	extract(in_any, argin);
@@ -318,7 +318,7 @@ CORBA::Any *AddStringClass::execute(Tango::DeviceImpl *device, const CORBA::Any
 //--------------------------------------------------------
 CORBA::Any *RemoveClass::execute(Tango::DeviceImpl *device, const CORBA::Any &in_any)
 {
-	cout2 << "RemoveClass::execute(): arrived" << endl;
+	TANGO_LOG_INFO << "RemoveClass::execute(): arrived" << endl;
 
 	const Tango::DevVarStringArray	*argin;
 	extract(in_any, argin);
@@ -514,7 +514,7 @@ void TestDeviceClass::device_factory(const Tango::DevVarStringArray *devlist_ptr
 	//	Create devices and add it into the device list
 	for (unsigned long i=0 ; i<devlist_ptr->length() ; i++)
 	{
-		cout4 << "Device name : " << (*devlist_ptr)[i].in() << endl;
+		TANGO_LOG_DEBUG << "Device name : " << (*devlist_ptr)[i].in() << endl;
 		device_list.push_back(new TestDevice(this, (*devlist_ptr)[i]));
 	}
 
@@ -695,7 +695,7 @@ void TestDeviceClass::create_static_attribute_list(vector<Tango::Attr *> &att_li
 		defaultAttList.push_back(att_name);
 	}
 
-	cout2 << defaultAttList.size() << " attributes in default list" << endl;
+	TANGO_LOG_INFO << defaultAttList.size() << " attributes in default list" << endl;
 
 
 	/*----- PROTECTED REGION ID(TestDevice::Class::create_static_att_list) ENABLED START -----*/
@@ -733,7 +733,7 @@ void TestDeviceClass::erase_dynamic_attributes(const Tango::DevVarStringArray *d
 			vector<string>::iterator ite_str = find(defaultAttList.begin(), defaultAttList.end(), att_name);
 			if (ite_str == defaultAttList.end())
 			{
-				cout2 << att_name << " is a UNWANTED dynamic attribute for device " << (*devlist_ptr)[i] << endl;
+				TANGO_LOG_INFO << att_name << " is a UNWANTED dynamic attribute for device " << (*devlist_ptr)[i] << endl;
 				Tango::Attribute &att = dev->get_device_attr()->get_attr_by_name(att_name.c_str());
 				dev->remove_attribute(att_list[att.get_attr_idx()],true);
 				--ite_att;
diff --git a/test/testdevice/src/TestDeviceClass.h b/test/testdevice/src/TestDeviceClass.h
index 0a58fc92fb68008befb1887296f1d22a494db6b6..5bf706dc2e2e24d1dad2b88b7a88b0772d56c9e5 100644
--- a/test/testdevice/src/TestDeviceClass.h
+++ b/test/testdevice/src/TestDeviceClass.h
@@ -22,15 +22,25 @@
 #ifndef TestDeviceCLASS_H
 #define TestDeviceCLASS_H
 
-#include <tango.h>
+#include <tango/tango.h>
 #include <TestDevice.h>
 
+#ifndef TANGO_LOG
+#define TANGO_LOG cout
+#endif
+#ifndef TANGO_LOG_INFO
+#define TANGO_LOG_INFO cout2
+#endif
+#ifndef TANGO_LOG_DEBUG
+#define TANGO_LOG_DEBUG cout4
+#endif
+
 /*----- PROTECTED REGION END -----*/
 
 namespace TestDevice_ns
 {
 	/*----- PROTECTED REGION ID(TestDevice::classes for dynamic creation) ENABLED START -----*/
-
+    using namespace std;
 	/*----- PROTECTED REGION END -----*/	//	TestDevice::classes for dynamic creation
 
 
diff --git a/test/testdevice/src/main.cpp b/test/testdevice/src/main.cpp
index 1dfa5f93bad2514a1e59ca645bcd2a4ea4157102..16ab44dbce054178690ba4e242bb6bf2f1649110 100644
--- a/test/testdevice/src/main.cpp
+++ b/test/testdevice/src/main.cpp
@@ -18,11 +18,12 @@
 //        (Program Obviously used to Generate tango Object)
 //=============================================================================
 
-#include <tango.h>
+#include <tango/tango.h>
 
 
 int main(int argc,char *argv[])
 {
+    using namespace std;
 	Tango::Util *tg = NULL;
 	try
 	{
@@ -37,20 +38,20 @@ int main(int argc,char *argv[])
 
 		// Run the endless loop
 		//----------------------------------------
-		cout << "Ready to accept request" << endl;
+		TANGO_LOG << "Ready to accept request" << endl;
 		tg->server_run();
 	}
 	catch (bad_alloc)
 	{
-		cout << "Can't allocate memory to store device object !!!" << endl;
-		cout << "Exiting" << endl;
+		TANGO_LOG << "Can't allocate memory to store device object !!!" << endl;
+		TANGO_LOG << "Exiting" << endl;
 	}
 	catch (CORBA::Exception &e)
 	{
 		Tango::Except::print_exception(e);
 		
-		cout << "Received a CORBA_Exception" << endl;
-		cout << "Exiting" << endl;
+		TANGO_LOG << "Received a CORBA_Exception" << endl;
+		TANGO_LOG << "Exiting" << endl;
 	}
 	if (tg!=NULL)
 		tg->server_cleanup();