--- /dev/null
+m4
+autom4te.cache
#!/bin/sh
+export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
if ! [ -e Makefile ] ;
then
echo "No Makefile available, generating it."
libtoolize --automake --force --copy
autoreconf --force --install
- PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/usr/local
+ ./configure --prefix=/usr/local
else
echo "Makefile found, no need to generate it."
fi
PKG_PROG_PKG_CONFIG()
-PKG_CHECK_MODULES(SRC, omniDynamic4)
+PKG_CHECK_MODULES(SRC, omniDynamic4 libplp)
AC_SUBST(SRC_CFLAGS)
AC_SUBST(SRC_LIBS)
* Author: lamikr
*/
+#include <plp/log.h>
+
#include "BusClient.hh"
#include "BusMessageInternal.hh"
BusClient::BusClient()
{
- cout << "created" << endl;
+ log_debug("created\n");;
_orb = NULL;
_poa = NULL;
}
_orb->destroy();
_orb = NULL;
}
- cout << "destroyed" << endl;
+ log_debug("destroyed\n");
}
int BusClient::init(const char *server_name) {
argc = 0;
argv = NULL;
- cout << "init() started" << endl;
+ log_info("init() started\n");;
_orb = CORBA::ORB_init(argc, argv);
if (_orb != NULL) {
- cout << "ORB_init() done, finding server: " << server_name << endl;
+ log_debug("ORB_init() done, finding server: %s\n", server_name);
server_obj = find_server_object_by_name(_orb,
CONST_CONTEXT_NAME__PLPBUS,
CONST_CONTEXT_KIND__PLPBUS,
CONST_CONTEXT_NAME__PLPBUS);
if (CORBA::is_nil(server_obj) == false) {
_server = plpbus_orb::OrbServer::_narrow(server_obj);
- cout << "Server object found: " << server_name << endl;
+ log_info("Server object found: %s", server_name);
}
else {
- cerr << "Could not find server object: " << server_name << endl;
+ log_error("Could not find server object: %s\n", server_name);
}
}
return 0;
}
int BusClient::add_client_listener(IClientListener *listener_param) {
- cout << "add_client_listener() started" << endl;
+ log_debug("add_client_listener() started\n");
if (_poa == NULL) {
OrbClientImpl *client_cb;
PortableServer::ObjectId_var oid;
- cout << "register_callback() 1" << endl;
_poa = create_poa(_orb);
client_cb = new OrbClientImpl(listener_param);
oid = _poa->activate_object(client_cb);
client_cb->_remove_ref();
_server->add_event_listener(_client, "event_message", CONST_DEFAULT_EVENT_INTERVAL);
}
- cout << "add_client_listener() done" << endl;
+ log_debug("add_client_listener() done\n");
return 0;
}
ret_val = ns_root_context->resolve(service_data);
}
catch(CosNaming::NamingContext::NotFound& ex) {
- cerr << "Could not find service from the name server. " << endl;
+ log_error("Could not find service from the name server.\n");
}
catch(CORBA::TRANSIENT& ex) {
- cerr << "Could not find service from the name server. " << endl;
+ log_error("Could not find service from the name server.\n");
}
catch(CORBA::SystemException& ex) {
- cerr << "Could not find service from the name server, unknown error." << endl;
+ log_error("Could not find service from the name server, unknown error.\n");
}
}
else {
- cerr << "Could not find naming service. " << endl;
+ log_error("Could not find naming service.\n");
}
return ret_val;
}
* Author: lamikr
*/
+#include <plp/log.h>
+
#include "BusMessage.hh"
using namespace std;
const char *val;
item->value >>= val;
- cout << " [" << index << "] name: " << item->name << ", value: " << val << endl;
+ log_debug(" [%d], value: %s\n", index, val);
}
break;
case tk_long:
{
long val;
item->value >>= val;
- cout << " [" << index << "] name: " << item->name << ", value: " << val << endl;
+ log_debug(" [%d], value: %ld\n", index, val);
//val_str = strdup("long");
}
break;
{
double val;
item->value >>= val;
- cout << " [" << index << "] name: " << item->name << ", value: " << val << endl;
+ log_debug(" [%d], value: %f\n", index, val);
//val_str = strdup("double");
}
break;
{
float val;
item->value >>= val;
- cout << " [" << index << "] name: " << item->name << ", value: " << val << endl;
+ log_debug(" [%d] name: %s, value: %f\n", index, val);
//val_str = strdup("float");
}
break;
default:
- cout << " [" << index << "] name: " << item->name << ", value unknown. " << endl;
+ log_error(" [%d] name, value unknown\n", index);
}
}
else {
- cout << " [" << index << "] Invalid dataItem, name or value NULL." << endl;
+ log_error(" [%d] Invalid data item name name or value\n", index);
}
}
else {
- cout << " [" << index << "] dataItem NULL." << endl;
+ log_error(" [%d] dataItem NULL.", index);
}
}
DataItem item;
count = _dataItemSeq.length();
- cout << "BusMessage.printout(): parameter count: " << count << endl;
+ log_debug("BusMessage.printout(): parameter count: %l\n", count);
for (long ii = 0; ii < count; ii++) {
item = _dataItemSeq[ii];
printout_dataitem(ii, &item);
}
- cout << "BusMessage.printout() done" << endl;
+ log_debug("BusMessage.printout() done\n");;
}
* Author: lamikr
*/
+#include <plp/log.h>
+
#include "ServerEventThread.hh"
#include "OrbServerImpl.hh"
#include "ClientServerCommon.hh"
OrbServerImpl::~OrbServerImpl()
{
- cout << "OrbServerImpl destroyed." << endl;
+ log_info("OrbServerImpl destroyed.\n");
}
void OrbServerImpl::send_message_and_request_response(OrbClient_ptr response_listener_param,
msg_rsp = NULL;
if (CORBA::is_nil(response_listener_param) == false) {
if (_listener != NULL) {
- cout << "send_message_and_request_response(): " << msg_req << ", server_callback != NULL" << endl;
+ log_debug("send_message_and_request_response(): %s, server callback != NULL\n", msg_req);
_listener->request_received(msg_req, &msg_rsp);
response_listener_param->receive_response_message(msg_rsp);
}
else {
- cout << "send_message_and_request_response() error! " << msg_req << ", server_callback == NULL" << endl;
+ log_error("send_message_and_request_response() error, server callback == NULL\n");
}
}
else {
- cerr << "invalid callback object received.\n";
+ log_error("invalid callback object received.\n");
}
}
err_flg = 0;
msg_rsp = NULL;
if (_listener != NULL) {
- cout << "send_message_and_wait_response(): " << msg_req_param << ", server_callback != NULL" << endl;
+ log_debug("send_message_and_wait_response(): %s, server_callback != NULL\n", msg_req_param);
_listener->request_received(msg_req_param, &msg_rsp);
}
else {
- cout << "send_message_and_wait_response() error! " << msg_req_param << ", server_callback == NULL" << endl;
+ log_error("send_message_and_wait_response() error, server callback == NULL\n");
msg_rsp = strdup(msg_req_param);
err_flg = -1;
}
if (CORBA::is_nil(response_listener_param) == false) {
if (_listener != NULL) {
msg_req = new BusMessageInternal(msg_req_param);
- cout << "send_dataitem_message_and_request_response(), server_callback != NULL" << endl;
- cout << "msg_req:" << endl;
+ log_debug("send_dataitem_message_and_request_response(), server_callback != NULL\n");
+ log_debug("msg_req:\n");
msg_req->printout();
msg_rsp = NULL;
_listener->request_received(msg_req, &msg_rsp);
- cout << "msg_rsp length:" << msg_rsp->_dataItemSeq.length() << endl;
+ log_debug("msg_rsp length: %d\n", msg_rsp->_dataItemSeq.length());
msg_rsp->printout();
response_listener_param->receive_response_dataitem_sequence(msg_rsp->_dataItemSeq);
}
else {
- cout << "send_dataitem_message_and_request_response() error, server_callback == NULL" << endl;
+ log_error("send_dataitem_message_and_request_response() error, server_callback == NULL\n");
}
}
}
ServerEventThread *srvr_thread;
if (CORBA::is_nil(client_param) == false) {
- cout << "add_event_listener()" << endl;
+ log_debug("add_event_listener()\n");
server_thread_mutex.lock();
_server_thread_count++;
server_thread_mutex.unlock();