Skip to content

Commit

Permalink
Remove log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sonndinh committed Mar 22, 2024
1 parent fb050ce commit fd8c895
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 44 deletions.
18 changes: 1 addition & 17 deletions src/NodeDRListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ NodeDRListener::NodeDRListener(DDS::DomainParticipant* dp,
, unsubscribing_(false)
, unsubscribed_(false)
, receiving_samples_(false)
, count_samples_(0)
{
uv_async_init(uv_default_loop(), &async_uv_, async_cb);
}
Expand Down Expand Up @@ -121,21 +120,7 @@ void NodeDRListener::reserve(CORBA::ULong)
void NodeDRListener::push_back(const DDS::SampleInfo& src, const void* sample)
{
std::unique_lock<std::mutex> lock(mutex_);
++count_samples_;
ACE_DEBUG((LM_DEBUG, "Receive sample number %u. Data pointer: %@\n", count_samples_, sample));
ACE_DEBUG((LM_DEBUG, "SampleInfo: {\n"));
ACE_DEBUG((LM_DEBUG, "sample_state: %d\n", src.sample_state));
ACE_DEBUG((LM_DEBUG, "view_state: %d\n", src.view_state));
ACE_DEBUG((LM_DEBUG, "instance_state: %d\n", src.instance_state));
ACE_DEBUG((LM_DEBUG, "instance_handle: %u\n", src.instance_handle));
ACE_DEBUG((LM_DEBUG, "publication_handle: %u\n", src.publication_handle));
ACE_DEBUG((LM_DEBUG, "disposed_generation_count: %u\n", src.disposed_generation_count));
ACE_DEBUG((LM_DEBUG, "no_writers_generation_count: %u\n", src.no_writers_generation_count));
ACE_DEBUG((LM_DEBUG, "valid_data: %d\n", src.valid_data));
ACE_DEBUG((LM_DEBUG, "}\n"));

if (unsubscribing_) {
ACE_DEBUG((LM_DEBUG, "unsubscribing_ value: %d\n", unsubscribing_));
return;
}

Expand All @@ -144,9 +129,8 @@ void NodeDRListener::push_back(const DDS::SampleInfo& src, const void* sample)
}

if (vd_) {
ACE_DEBUG((LM_DEBUG, "Write sample using NodeValueWriter...\n"));
if (!vd_->write(nvw_, sample)) {
ACE_ERROR((LM_ERROR, "ERROR: ValueDispatcher write failed\n"));
ACE_ERROR((LM_WARNING, "WARNING: ValueDispatcher write failed\n"));
return;
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/NodeDRListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ namespace NodeOpenDDS {
/// True if Datareader Listener taking samples.
bool receiving_samples_;

unsigned long count_samples_;

mutable std::mutex mutex_;
};

Expand Down
12 changes: 0 additions & 12 deletions src/NodeValueReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,49 +39,40 @@ NodeValueReader::NodeValueReader(v8::Local<v8::Object> obj)

bool NodeValueReader::begin_struct(OpenDDS::DCPS::Extensibility /*extensibility*/)
{
ACE_DEBUG((LM_DEBUG, "begin_struct\n"));
return begin_nested();
}

bool NodeValueReader::end_struct()
{
ACE_DEBUG((LM_DEBUG, "end_struct\n"));
return end_nested();
}

bool NodeValueReader::begin_struct_member(OpenDDS::XTypes::MemberId& member_id, const OpenDDS::DCPS::MemberHelper& helper)
{
ACE_DEBUG((LM_DEBUG, "begin_struct_member...\n"));
while (members_remaining()) {
Nan::MaybeLocal<v8::Value> mlv = Nan::Get(property_names_.ToLocalChecked(), current_index_);
// mlv is not empty at this point.
current_property_name_ = mlv.ToLocalChecked();
Nan::Utf8String name(current_property_name_);
ACE_DEBUG((LM_DEBUG, "Member name: %C\n", *name));
if (helper.get_value(member_id, *name)) {
return true;
}
++current_index_;
}
ACE_DEBUG((LM_DEBUG, "No members remaining\n"));
return false;
}

bool NodeValueReader::members_remaining()
{
ACE_DEBUG((LM_DEBUG, "members_remaining...\n"));
if (!property_names_.IsEmpty()) {
while (current_index_ < property_names_.ToLocalChecked()->Length()) {
ACE_DEBUG((LM_DEBUG, "current_index_: %u\n", current_index_));
Nan::MaybeLocal<v8::Value> mlv = Nan::Get(property_names_.ToLocalChecked(), current_index_);
if (!mlv.IsEmpty()) {
ACE_DEBUG((LM_DEBUG, "Returning true\n"));
return true;
}
++current_index_;
}
}
ACE_DEBUG((LM_DEBUG, "Returning false\n"));
return false;
}

Expand All @@ -98,7 +89,6 @@ bool NodeValueReader::member_has_value()

bool NodeValueReader::end_struct_member()
{
ACE_DEBUG((LM_DEBUG, "end_struct_member\n"));
++current_index_;
return true;
}
Expand Down Expand Up @@ -425,10 +415,8 @@ bool NodeValueReader::begin_nested()
property_names_ = Nan::GetPropertyNames(current_object_);
current_property_name_.Clear();

ACE_DEBUG((LM_DEBUG, "Returning true\n"));
return true;
}
ACE_DEBUG((LM_DEBUG, "Returning false\n"));
return false;
}

Expand Down
13 changes: 0 additions & 13 deletions src/node-opendds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,19 +379,6 @@ namespace {
const Local<Value> dwqos_lv = Nan::Get(qos_js, dwqos_lstr).ToLocalChecked();
if (dwqos_lv->IsObject()) {
try {
v8::Local<v8::Object> tmp = dwqos_lv->ToObject(Nan::GetCurrentContext()).ToLocalChecked();
//v8::Local<v8::Array> property_names = tmp->GetOwnPropertyNames(Nan::GetCurrentContext()).ToLocalChecked();
v8::MaybeLocal<v8::Array> property_names = Nan::GetPropertyNames(tmp);
for (uint32_t i = 0; i < property_names.ToLocalChecked()->Length(); ++i) {
//v8::Local<v8::Value> key = property_names->Get(Nan::GetCurrentContext(), i).ToLocalChecked();
//v8::Local<v8::Value> value = obj->Get(isolate->GetCurrentContext(), key).ToLocalChecked();

//v8::String::Utf8Value utf8_key(Nan::GetCurrentContext, key);
//v8::String::Utf8Value utf8_value(isolate, value);
Nan::MaybeLocal<v8::Value> mlv = Nan::Get(property_names.ToLocalChecked(), i);
Nan::Utf8String name(mlv.ToLocalChecked());
ACE_DEBUG((LM_DEBUG, "DataWriterQos property name: %C\n", *name));
}
NodeValueReader nvr(dwqos_lv->ToObject(Nan::GetCurrentContext()).ToLocalChecked());
if (!OpenDDS::DCPS::vread(nvr, dw_qos)) {
throw std::runtime_error("Unable to convert datawriter qos policy");
Expand Down

0 comments on commit fd8c895

Please sign in to comment.