ETCH-280 Updating CAPU and adapting logger interface
This patch upgrades to CMake dependency to capu 0.13.0.
Due to this upgrade the logger interface needs to be changed
to use the new logging mechanism provided by CAPU 0.13.0.
In order to achieve this the EtchLogger has been extended by
a new macro called ETCH_LOG_<LOGLEVEL> in order to add an
abstraction from the CAPU logger.
Change-Id: I118008422c63d9406d006afe1193ba9d49c3213b
git-svn-id: https://svn.apache.org/repos/asf/etch/trunk@1548398 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/stub_h.vm b/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/stub_h.vm
index 990f716..88b0229 100644
--- a/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/stub_h.vm
+++ b/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/stub_h.vm
@@ -60,12 +60,12 @@
status_t run(EtchStubBase<$i$suffix>* _ref, EtchDeliveryService *_svc, $i$suffix *_obj, capu::SmartPointer<EtchWho> _sender, capu::SmartPointer<EtchMessage> _msg )
{
status_t status = ETCH_OK;
- CAPU_LOG_TRACE(mRuntime->getLogger(), "Stub$i$suffix", "${namespace}: Called ${mthd.vname($helper)} Run-Method.");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Stub$i$suffix ${namespace}: Called ${mthd.vname($helper)} Run-Method.");
#if (!$mthd.isOneway())
capu::SmartPointer<EtchMessage> _rmsg;
status = _msg->createReplyMessage(_rmsg);
if(status != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), "Stub$i$suffix", "${namespace}: Coudn't create reply-message.");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Stub$i$suffix ${namespace}: Coudn't create reply-message.");
// TODO set exception
return ETCH_ERROR;
}
@@ -84,18 +84,18 @@
$intfname::$mthd.name()AsyncResultPtr ar;
#set($sep = "")
#set($count = 0)
- CAPU_LOG_TRACE(mRuntime->getLogger(), "Stub$i$suffix", "${namespace}: Calling implementation of \"$mthd.name()\" function.");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Stub$i$suffix ${namespace}: Calling implementation of \"$mthd.name()\" function.");
ar = _obj->$mthd.name()(#foreach($param in $mthd.iterator())#set($count = $count + 1)${sep}val$count#set($sep = ", ")#end);
// create result message
#if($mthd.hasReturn())
if(ar->hasResult()) {
- CAPU_LOG_TRACE(mRuntime->getLogger(), "Stub$i$suffix", "${namespace}: $mthd.name() - returned an Result, generating Answer Message.");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Stub$i$suffix ${namespace}: $mthd.name() - returned an Result, generating Answer Message.");
_rmsg->put(ValueFactory$i::_mf_result(), ar->getResult());
} else
#end
if(ar->hasException()) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "Stub$i$suffix", "${namespace}: $mthd.name() - returned an Exception - notify Session.");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Stub$i$suffix ${namespace}: $mthd.name() - returned an Exception - notify Session.");
_ref->sessionNotify(ar->getException());
#if ($mthd.isOneway())
EtchMessagePtr _rmsg;
@@ -104,14 +104,14 @@
_rmsg->put( ValueFactory$i::_mf_result(), ar->getException() );
#if ($mthd.isOneway())
// transport result message
- CAPU_LOG_TRACE(mRuntime->getLogger(), "Stub$i$suffix", "${namespace}: $mthd.name() - (One-Way) Transport Message back! Because an Exception occurred!.");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Stub$i$suffix ${namespace}: $mthd.name() - (One-Way) Transport Message back! Because an Exception occurred!.");
status = _svc->transportMessage( _sender, _rmsg);
#end
}
#if (!$mthd.isOneway())
// transport result message
- CAPU_LOG_TRACE(mRuntime->getLogger(), "Stub$i$suffix", "${namespace}: $mthd.name() - Transport answer-message back!.");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Stub$i$suffix ${namespace}: $mthd.name() - Transport answer-message back!.");
status = _svc->transportMessage( _sender, _rmsg);
#end
return status;
diff --git a/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/vf_cpp.vm b/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/vf_cpp.vm
index 09561a9..f06aa35 100644
--- a/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/vf_cpp.vm
+++ b/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/vf_cpp.vm
@@ -80,7 +80,7 @@
_struct->put($vf::$p.vname($helper)(), val$CountParams );
#end
result = _struct;
- CAPU_LOG_TRACE(mRuntime->getLogger(), "$vf", "${namespace}: exported $n.vname($helper) Value.");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Valuefactory ${namespace}: exported $n.vname($helper) Value.");
return ETCH_OK;
}
status_t importValue(EtchStructValue* value, EtchObjectPtr &result)
@@ -96,7 +96,7 @@
v->$helper.getSetterName($p.name())(tmp$CountParams);
#end
result = v;
- CAPU_LOG_TRACE(mRuntime->getLogger(), "$vf", "${namespace}: imported $n.vname($helper) Value.");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Valuefactory ${namespace}: imported $n.vname($helper) Value.");
return ETCH_OK;
}
};
diff --git a/binding-cpp/runtime/FindCapu.cmake b/binding-cpp/runtime/FindCapu.cmake
index 4d8b880..dc82746 100644
--- a/binding-cpp/runtime/FindCapu.cmake
+++ b/binding-cpp/runtime/FindCapu.cmake
@@ -38,7 +38,7 @@
ExternalProject_Add(
Capu
- URL https://github.com/bmwcarit/capu/archive/v0.9.0.zip
+ URL https://github.com/bmwcarit/capu/archive/v0.13.0.zip
SOURCE_DIR "${CAPU_PROJECT_DIR}"
BINARY_DIR "${CAPU_CMAKE_BUILD_DIR}"
INSTALL_DIR "${CAPU_PROJECT_DIR}/deliverable"
diff --git a/binding-cpp/runtime/include/support/EtchRuntime.h b/binding-cpp/runtime/include/support/EtchRuntime.h
index ae7a8e1..f8ca116 100644
--- a/binding-cpp/runtime/include/support/EtchRuntime.h
+++ b/binding-cpp/runtime/include/support/EtchRuntime.h
@@ -94,6 +94,7 @@
private:
capu::bool_t mIsClosed;
EtchLogger mLogger;
+ EtchConsoleLogAppender mLogAppender;
static capu::uint64_t sId;
capu::uint64_t mId;
capu::Mutex mMutex;
diff --git a/binding-cpp/runtime/include/util/EtchLogger.h b/binding-cpp/runtime/include/util/EtchLogger.h
index f4ba1b8..b093c79 100644
--- a/binding-cpp/runtime/include/util/EtchLogger.h
+++ b/binding-cpp/runtime/include/util/EtchLogger.h
@@ -19,12 +19,78 @@
#ifndef __ETCHLOGGER_H__
#define __ETCHLOGGER_H__
-#include "capu/util/Appender.h"
#include "capu/util/Logger.h"
-#include "capu/util/ConsoleAppender.h"
+#include "capu/util/ConsoleLogAppender.h"
+#include "capu/util/LogContext.h"
+#include "capu/util/ILogAppender.h"
-typedef capu::Appender EtchAppender;
-typedef capu::ConsoleAppender EtchConsoleAppender;
-typedef capu::Logger EtchLogger;
+typedef capu::ILogAppender IEtchLogAppender;
+typedef capu::ConsoleLogAppender EtchConsoleLogAppender;
+typedef capu::LogContext EtchLogContext;
+
+#define ETCH_LOG_TRACE(logger, context, message) \
+ LOG_TRACE_EXT(logger, (context), message);
+
+#define ETCH_LOG_DEBUG(logger, context, message) \
+ LOG_DEBUG_EXT(logger, (context), message);
+
+#define ETCH_LOG_INFO(logger, context, message) \
+ LOG_INFO_EXT(logger, (context), message);
+
+#define ETCH_LOG_WARN(logger, context, message) \
+ LOG_WARN_EXT(logger, (context), message);
+
+#define ETCH_LOG_ERROR(logger, context, message) \
+ LOG_ERROR_EXT(logger, (context), message);
+
+class EtchLogger: public capu::Logger {
+public:
+ EtchLogger(IEtchLogAppender& logAppender) : capu::Logger(logAppender)
+ , mSerializerContext("etch.runtime.messagizer.serializer")
+ , mDeliveryServiceContext("etch.runtime.deliveryservice")
+ , mTransportContext("etch.runtime.transport")
+ , mPacketizerContext("etch.runtime.packetizer")
+ , mMessagizerContext("etch.runtime.messagizer")
+ , mValidatorContext("etch.runtime.messagizer.validator")
+ , mMailboxContext("etch.runtime.mailbox")
+ , mRuntimeContext("etch.runtime")
+ {
+
+ }
+ EtchLogContext& getSerializerContext() {
+ return mSerializerContext;
+ }
+ EtchLogContext& getDeliveryServiceContext() {
+ return mDeliveryServiceContext;
+ }
+ EtchLogContext& getTransportContext() {
+ return mTransportContext;
+ }
+ EtchLogContext& getPacketizerContext() {
+ return mPacketizerContext;
+ }
+ EtchLogContext& getMessagizerContext() {
+ return mMessagizerContext;
+ }
+ EtchLogContext& getValidatorContext() {
+ return mValidatorContext;
+ }
+ EtchLogContext& getMailboxContext() {
+ return mMailboxContext;
+ }
+ EtchLogContext& getRuntimeContext() {
+ return mRuntimeContext;
+ }
+private:
+ EtchLogContext mSerializerContext;
+ EtchLogContext mDeliveryServiceContext;
+ EtchLogContext mTransportContext;
+ EtchLogContext mPacketizerContext;
+ EtchLogContext mMessagizerContext;
+ EtchLogContext mValidatorContext;
+ EtchLogContext mMailboxContext;
+ EtchLogContext mRuntimeContext;
+
+};
#endif /* ETCHLOGGER_H */
diff --git a/binding-cpp/runtime/src/main/serialization/EtchAuthenticationExceptionSerializer.cpp b/binding-cpp/runtime/src/main/serialization/EtchAuthenticationExceptionSerializer.cpp
index 78c2691..580dcab 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchAuthenticationExceptionSerializer.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchAuthenticationExceptionSerializer.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchAuthenticationExceptionSerializer.h"
#include "support/EtchRuntime.h"
-static const char* TAG = "EtchAuthenticationExceptionSerializer";
-
const EtchString& EtchAuthenticationExceptionSerializer::FIELD_NAME() {
static const EtchString name("msg");
return name;
@@ -42,12 +40,12 @@
capu::SmartPointer<EtchObject> tmp;
if (value->get(mField, &tmp) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Msg Field could not be found");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Msg Field could not be found");
return ETCH_ERROR;
}
EtchString str = *((EtchString*) tmp.get());
result = new EtchAuthenticationException(str);
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Exception has been deserialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Exception has been deserialized");
return ETCH_OK;
}
@@ -60,7 +58,8 @@
EtchString *str = new EtchString(((EtchAuthenticationException*) value.get())->getErrorMessage());
if (result->put(mField, str) != ETCH_OK)
return ETCH_ERROR;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Exception has been serialized");
+
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Exception has been serialized");
return ETCH_OK;
}
@@ -95,6 +94,6 @@
}
type->lock();
- CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchAuthenticationExceptionSerializer has been initialized");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getSerializerContext(), "EtchAuthenticationExceptionSerializer has been initialized");
return ETCH_OK;
}
diff --git a/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataInput.cpp b/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataInput.cpp
index 31b745c..0749e42 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataInput.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataInput.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchBinaryTaggedDataInput.h"
#include "support/EtchRuntime.h"
-static const char* TAG = "EtchBinaryTaggedDataInput";
-
EtchBinaryTaggedDataInput::EtchBinaryTaggedDataInput(EtchRuntime* runtime, EtchValueFactory* vf)
: EtchBinaryTaggedData(vf), mRuntime(runtime), mBuffer(NULL), mLengthBudget(0) {
//get int validator
@@ -57,7 +55,7 @@
if (ret != ETCH_OK) {
mBuffer = NULL;
mLengthBudget = 0;
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Deserialization of Message header has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Deserialization of Message header has failed");
return ret;
}
@@ -65,7 +63,7 @@
if (ret != ETCH_OK) {
mBuffer = NULL;
mLengthBudget = 0;
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Deserialization of Message body has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Deserialization of Message body has failed");
return ret;
}
@@ -73,7 +71,7 @@
if (ret != ETCH_OK) {
mBuffer = NULL;
mLengthBudget = 0;
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Deserialization of Message end has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Deserialization of Message end has failed");
return ret;
}
@@ -85,19 +83,19 @@
ret = startStruct(result);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Reading header of struct has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Reading header of struct has failed");
return ret;
}
ret = readKeysAndValues(result);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Reading body of struct has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Reading body of struct has failed");
return ret;
}
ret = endStruct(result);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Reading end of struct has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Reading end of struct has failed");
return ret;
}
@@ -109,19 +107,19 @@
ret = startArray(result);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Reading header of array has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Reading header of array has failed");
return ret;
}
ret = readValues(result, v);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Reading body of array has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Reading body of array has failed");
return ret;
}
ret = endArray(result);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Reading end of array has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Reading end of array has failed");
return ret;
}
return ETCH_OK;
@@ -179,19 +177,19 @@
mBuffer->getByte(version);
if (version != VERSION()) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Incorrect serializer version");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Incorrect serializer version");
return ETCH_EIO;
}
EtchType *type = NULL;
if (readType(type) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Type information is not read correctly");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Type information is not read correctly");
return ETCH_EIO;
}
capu::int32_t length = 0;
if (readLength(length) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Length of message is not read correctly");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Length of message is not read correctly");
return ETCH_EIO;
}
@@ -206,13 +204,13 @@
status_t EtchBinaryTaggedDataInput::startStruct(capu::SmartPointer<EtchStructValue> &result) {
EtchType* t = NULL;
if (readType(t) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "type of struct is not read correctly");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "type of struct is not read correctly");
return ETCH_ERROR;
}
capu::int32_t length;
if (readLength(length) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Length of struct is not read correctly");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Length of struct is not read correctly");
return ETCH_ERROR;
}
@@ -231,7 +229,7 @@
EtchType* customStructType = NULL;
if (type == EtchTypeCode::CUSTOM || type == EtchTypeCode::STRUCT) {
if (readType(customStructType) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "type of array is not read correctly");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "type of array is not read correctly");
return ETCH_ERROR;
}
} else {
@@ -240,24 +238,24 @@
capu::int32_t dim;
if (readIntegerValue(dim) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "dimension of array is not read correctly");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "dimension of array is not read correctly");
return ETCH_EINVAL;
}
if (dim <= 0 || dim > (capu::int32_t)EtchValidator::MAX_NDIMS) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "dimension of array is not within predefined limits");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "dimension of array is not within predefined limits");
return ETCH_EINVAL;
}
capu::int32_t length;
if (readLength(length) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "length of array is not read correctly");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "length of array is not read correctly");
return ETCH_ERROR;
}
capu::SmartPointer<EtchNativeArrayBase> array;
if (allocNativeArray(type, customStructType, dim, length, array) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Allocation of array with specified type has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Allocation of array with specified type has failed");
return ETCH_ERROR;
}
@@ -337,7 +335,7 @@
status_t EtchBinaryTaggedDataInput::readLength(capu::int32_t& result) {
capu::int32_t length = 0;
if (readIntegerValue(length) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "length information is not read correctly");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "length information is not read correctly");
return ETCH_ERROR;
}
@@ -428,7 +426,7 @@
if (validateValue(v, boolean, result) != ETCH_OK) {
return ETCH_ERROR;
} else {
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Boolean false value has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Boolean false value has been received");
return ETCH_OK;
}
}
@@ -439,7 +437,7 @@
if (validateValue(v, boolean, result) != ETCH_OK) {
return ETCH_ERROR;
} else {
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Boolean true value has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Boolean true value has been received");
return ETCH_OK;
}
@@ -454,7 +452,7 @@
if (validateValue(v, byte, result) != ETCH_OK) {
return ETCH_ERROR;
} else {
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Byte value has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Byte value has been received");
return ETCH_OK;
}
}
@@ -468,7 +466,7 @@
if (validateValue(v, shortNum, result) != ETCH_OK) {
return ETCH_ERROR;
} else {
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Short value has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Short value has been received");
return ETCH_OK;
}
}
@@ -482,7 +480,7 @@
if (validateValue(v, intNum, result) != ETCH_OK) {
return ETCH_ERROR;
} else {
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Int value has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Int value has been received");
return ETCH_OK;
}
}
@@ -496,7 +494,7 @@
if (validateValue(v, longNum, result) != ETCH_OK) {
return ETCH_ERROR;
} else {
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Long value has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Long value has been received");
return ETCH_OK;
}
}
@@ -510,7 +508,7 @@
if (validateValue(v, floatNum, result) != ETCH_OK) {
return ETCH_ERROR;
} else {
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Float value has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Float value has been received");
return ETCH_OK;
}
}
@@ -524,7 +522,7 @@
if (validateValue(v, doubleNum, result) != ETCH_OK) {
return ETCH_ERROR;
} else {
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Double value has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Double value has been received");
return ETCH_OK;
}
}
@@ -547,7 +545,7 @@
ret = validateValue(v, narray, result);
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Byte Array has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Byte Array has been received");
return ret;
}
@@ -583,7 +581,7 @@
return ETCH_ERROR;
} else {
result = array;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Array has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Array has been received");
return ETCH_OK;
}
}
@@ -595,7 +593,7 @@
return ETCH_ERROR;
} else {
result = str;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Empty String value has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Empty String value has been received");
return ETCH_OK;
}
}
@@ -617,7 +615,7 @@
return ETCH_ERROR;
} else {
result = str;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "String value has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "String value has been received");
return ETCH_OK;
}
}
@@ -637,7 +635,7 @@
if (validateValue(v, obj, result) != ETCH_OK) {
return ETCH_ERROR;
} else {
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Custom value has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Custom value has been received");
return ETCH_OK;
}
}
@@ -649,7 +647,7 @@
if (validateValue(v, tmp, result) != ETCH_OK) {
return ETCH_ERROR;
} else {
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Tiny Int value has been received");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Tiny Int value has been received");
return ETCH_OK;
}
}
diff --git a/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataOutput.cpp b/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataOutput.cpp
index daecf93..b04eb6f 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataOutput.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataOutput.cpp
@@ -18,8 +18,6 @@
#include "serialization/EtchBinaryTaggedDataOutput.h"
#include "support/EtchRuntime.h"
-static char* TAG = "EtchBinaryTaggedDataOutput";
-
const EtchString& EtchBinaryTaggedDataOutput::STRING_TYPE_AND_FIELD() {
static const EtchString name("BinaryTaggedDataOutput.stringTypeAndField");
return name;
@@ -51,19 +49,19 @@
ret = startMessage(msg);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of Message header has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of Message header has failed");
return ETCH_ERROR;
}
ret = writeKeysAndValues(msg);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of Message body has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of Message body has failed");
return ETCH_ERROR;
}
ret = endMessage(msg);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of Message end has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of Message end has failed");
return ETCH_ERROR;
}
@@ -75,19 +73,19 @@
ret = startStruct(sv);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of struct header has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of struct header has failed");
return ETCH_ERROR;
}
ret = writeKeysAndValues(sv);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of struct body has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of struct body has failed");
return ETCH_ERROR;
}
ret = endStruct(sv);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of struct end has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of struct end has failed");
return ETCH_ERROR;
}
@@ -99,19 +97,19 @@
ret = startArray(av);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of array header has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of array header has failed");
return ETCH_ERROR;
}
ret = writeValues(av, v);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of array body has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of array body has failed");
return ETCH_ERROR;
}
ret = endArray(av);
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of array end has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of array end has failed");
return ETCH_ERROR;
}
@@ -192,10 +190,10 @@
// the caller has already written a type code to indicate a
// struct is starting. this code is shared by startMessage().
if (writeType(_struct->getType()) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of struct type information has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of struct type information has failed");
return ETCH_ERROR;
} else if (writeIntValue(_struct->count()) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of field number on struct has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of field number on struct has failed");
return ETCH_ERROR;
}
return ETCH_OK;
@@ -221,20 +219,20 @@
if (type == EtchTypeCode::CUSTOM) {
ret = writeType(array->getCustomStructType());
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of array type information has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of array type information has failed");
return ETCH_ERROR;
}
}
ret = writeIntValue(array->getDim());
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of array dimension information has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of array dimension information has failed");
return ETCH_ERROR;
}
ret = writeIntValue(array->getSize());
if (ret != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of array size information has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Serialization of array size information has failed");
return ETCH_ERROR;
}
@@ -296,38 +294,38 @@
case EtchTypeCode::NONE:
return ETCH_OK;
case EtchTypeCode::BOOLEAN_FALSE:
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Boolean False has been serialized. (No Data send - encoded via TypeId)");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Boolean False has been serialized. (No Data send - encoded via TypeId)");
return ETCH_OK;
case EtchTypeCode::BOOLEAN_TRUE:
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Boolean True has been serialized. (No Data send - encoded via TypeId)");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Boolean True has been serialized. (No Data send - encoded via TypeId)");
return ETCH_OK;
case EtchTypeCode::EMPTY_STRING:
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Empty String has been serialized. (No Data send - encoded via TypeId)");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Empty String has been serialized. (No Data send - encoded via TypeId)");
return ETCH_OK;
case EtchTypeCode::BYTE:
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Byte has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Byte has been serialized");
return mBuffer->putByte(((EtchNumber*) value.get())->getByteValue());
case EtchTypeCode::SHORT:
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Short has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Short has been serialized");
return mBuffer->putShort(((EtchNumber*) value.get())->getShortValue());
case EtchTypeCode::INT:
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Int has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Int has been serialized");
return mBuffer->putInt(((EtchNumber*) value.get())->getInt32Value());
case EtchTypeCode::LONG:
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Long has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Long has been serialized");
return mBuffer->putLong(((EtchNumber*) value.get())->getLongValue());
case EtchTypeCode::FLOAT:
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Float has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Float has been serialized");
return mBuffer->putFloat(((EtchFloat*) value.get())->get());
case EtchTypeCode::DOUBLE:
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Double has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Double has been serialized");
return mBuffer->putDouble(((EtchDouble*) value.get())->get());
@@ -338,7 +336,7 @@
na->get(Pos(0), data, na->getLength(), 0, na->getLength());
status_t ret = writeBytes(data, na->getLength());
delete[] data;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Byte Array has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Byte Array has been serialized");
return ret;
}
@@ -355,37 +353,37 @@
{
EtchArrayValue *val = NULL;
if (toArrayValue(value, v.get(), val) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Array couldn't be serialized");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Array couldn't be serialized");
return ETCH_ERROR;
}
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Array has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Array has been serialized");
return writeArray(val, v.get());
}
case EtchTypeCode::STRING:
{
capu::SmartPointer<EtchString> str = capu::smartpointer_cast<EtchString > (value);
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "String has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "String has been serialized");
return writeBytes((capu::int8_t*)str->c_str(), str->getNumBytes());
}
case EtchTypeCode::CUSTOM:
{
EtchStructValue* _struct;
if (mVf->exportCustomValue(value, _struct) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Custom Data Type couldn't be serialized");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Custom Data Type couldn't be serialized");
return ETCH_ERROR;
}
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Custom Data Type has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Custom Data Type has been serialized");
return writeStruct(_struct);
}
default:
// type is either "tiny" integer or unused
if (typeCode >= EtchTypeCode::MIN_TINY_INT && typeCode <= EtchTypeCode::MAX_TINY_INT) {
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Tiny Int has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Tiny Int has been serialized");
return ETCH_OK;
}
//invalid type
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Attempted serialization of an invalid Data Type");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Attempted serialization of an invalid Data Type");
return ETCH_EINVAL;
}
return ETCH_ERROR;
diff --git a/binding-cpp/runtime/src/main/serialization/EtchDateSerializer.cpp b/binding-cpp/runtime/src/main/serialization/EtchDateSerializer.cpp
index 2e98702..eb769ec 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchDateSerializer.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchDateSerializer.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchDateSerializer.h"
#include "support/EtchRuntime.h"
-static char* TAG = "EtchDateSerializer";
-
const EtchString& EtchDateSerializer::FIELD_NAME() {
static const EtchString name("dateTime");
return name;
@@ -42,13 +40,13 @@
capu::SmartPointer<EtchObject> tmp;
if (value->get(mField, &tmp) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "DateTime Field could not be found");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "DateTime Field could not be found");
return ETCH_ERROR;
}
EtchLong date = *((EtchLong*) tmp.get());
result = new EtchDate((capu::time_t)date.get());
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Date has been deserialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Date has been deserialized");
return ETCH_OK;
}
@@ -61,7 +59,7 @@
EtchLong *date = new EtchLong(((EtchDate*) value.get())->get());
if (result->put(mField, date) != ETCH_OK)
return ETCH_ERROR;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Date has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Date has been serialized");
return ETCH_OK;
}
@@ -97,6 +95,6 @@
}
type->lock();
- CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchDateSerializer has been initialized");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getSerializerContext(), "EtchDateSerializer has been initialized");
return ETCH_OK;
}
diff --git a/binding-cpp/runtime/src/main/serialization/EtchHashTableSerializer.cpp b/binding-cpp/runtime/src/main/serialization/EtchHashTableSerializer.cpp
index d7232ec..ae54c35 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchHashTableSerializer.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchHashTableSerializer.cpp
@@ -20,8 +20,6 @@
#include "serialization/EtchHashTableSerializer.h"
#include "support/EtchRuntime.h"
-static char* TAG = "EtchHashTableSerializer";
-
const EtchString& EtchHashTableSerializer::FIELD_NAME() {
static const EtchString name("keysAndValues");
return name;
@@ -59,7 +57,7 @@
if (result->put(mField, keysAndValuesArray) != ETCH_OK) {
return ETCH_ERROR;
}
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "HashTable has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "HashTable has been serialized");
return ETCH_OK;
}
@@ -71,7 +69,7 @@
}
capu::SmartPointer<EtchObject> tmp;
if (value->get(mField, &tmp) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "KeysAndValues Field could not be found");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "KeysAndValues Field could not be found");
return ETCH_ERROR;
}
@@ -92,7 +90,7 @@
return res;
}
result = (EtchObject*) table;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "HashTable has been deserialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "HashTable has been deserialized");
return ETCH_OK;
}
@@ -127,6 +125,6 @@
}
type->lock();
- CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchHashTableSerializer has been initialized");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getSerializerContext(), "EtchHashTableSerializer has been initialized");
return ETCH_OK;
}
diff --git a/binding-cpp/runtime/src/main/serialization/EtchListSerializer.cpp b/binding-cpp/runtime/src/main/serialization/EtchListSerializer.cpp
index c8aa122..8ec700b 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchListSerializer.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchListSerializer.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchListSerializer.h"
#include "support/EtchRuntime.h"
-static char* TAG = "EtchListSerializer";
-
const EtchString& EtchListSerializer::FIELD_NAME() {
static const EtchString name("values");
return name;
@@ -56,7 +54,7 @@
result = new EtchStructValue(mType, vf);
if (result->put(mField, values) != ETCH_OK)
return ETCH_ERROR;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "List has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "List has been serialized");
return ETCH_OK;
}
@@ -70,7 +68,7 @@
capu::SmartPointer<EtchObject> tmp = NULL;
if (value->get(mField, &tmp) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Values Field could not be found");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Values Field could not be found");
return ETCH_ERROR;
}
@@ -86,7 +84,7 @@
return res;
}
result = (EtchObject*) list;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "List has been deserialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "List has been deserialized");
return ETCH_OK;
}
@@ -122,6 +120,6 @@
}
type->lock();
- CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchListSerializer has been initialized");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getSerializerContext(), "EtchListSerializer has been initialized");
return ETCH_OK;
}
diff --git a/binding-cpp/runtime/src/main/serialization/EtchRuntimeExceptionSerializer.cpp b/binding-cpp/runtime/src/main/serialization/EtchRuntimeExceptionSerializer.cpp
index 08a97b7..36dcdf1 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchRuntimeExceptionSerializer.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchRuntimeExceptionSerializer.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchRuntimeExceptionSerializer.h"
#include "support/EtchRuntime.h"
-static char* TAG = "EtchRuntimeExceptionSerializer";
-
const EtchString& EtchRuntimeExceptionSerializer::FIELD_NAME() {
static const EtchString name("msg");
return name;
@@ -45,13 +43,13 @@
capu::SmartPointer<EtchObject> tmp;
if (value->get(mField, &tmp) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Msg Field could not be found");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Msg Field could not be found");
return ETCH_ERROR;
}
EtchString str = *((EtchString*) tmp.get());
result = new EtchRuntimeException(str, ETCH_ERROR);
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Exception has been deserialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Exception has been deserialized");
return ETCH_OK;
}
@@ -65,7 +63,7 @@
if (result->put(mField, str) != ETCH_OK)
return ETCH_ERROR;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Exception has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Exception has been serialized");
return ETCH_OK;
}
@@ -101,6 +99,6 @@
//lock type
type->lock();
- CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchRuntimeExceptionSerializer has been initialized");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getSerializerContext(), "EtchRuntimeExceptionSerializer has been initialized");
return ETCH_OK;
}
diff --git a/binding-cpp/runtime/src/main/serialization/EtchSetSerializer.cpp b/binding-cpp/runtime/src/main/serialization/EtchSetSerializer.cpp
index d1e14a5..3956863 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchSetSerializer.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchSetSerializer.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchSetSerializer.h"
#include "support/EtchRuntime.h"
-static const char* TAG = "EtchSetSerializer";
-
const EtchString& EtchSetSerializer::FIELD_NAME() {
static const EtchString name("keys");
return name;
@@ -55,7 +53,7 @@
result = new EtchStructValue(mType, vf);
if (result->put(mField, array) != ETCH_OK)
return ETCH_ERROR;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Set has been serialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Set has been serialized");
return ETCH_OK;
}
@@ -67,7 +65,7 @@
}
capu::SmartPointer<EtchObject> tmp;
if (value->get(mField, &tmp) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Keys Field could not be found");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Keys Field could not be found");
return ETCH_ERROR;
}
@@ -83,7 +81,7 @@
return res;
}
result = (capu::SmartPointer<EtchObject>) set;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Set has been deserialized");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getSerializerContext(), "Set has been deserialized");
return ETCH_OK;
}
@@ -118,6 +116,6 @@
}
type->lock();
- CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchSetSerializer has been initialized");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getSerializerContext(), "EtchSetSerializer has been initialized");
return ETCH_OK;
}
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp
index a4741fd..fa07989 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchValidatorBoolean.h"
#include "support/EtchRuntime.h"
-static const char* TAG = "EtchValidatorBoolean";
-
capu::SmartPointer<EtchValidator>* EtchValidatorBoolean::Validators(EtchRuntime* runtime) {
static EtchValidatorCaches validators;
return validators.get(runtime);
@@ -68,11 +66,11 @@
status_t EtchValidatorBoolean::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
if (validate(value)) {
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Object has been validated");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Boolean object validation successful");
result = value;
return ETCH_OK;
} else {
- CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Boolean object validation failed");
return ETCH_ERROR;
}
}
@@ -87,7 +85,7 @@
}
if (Validators(runtime)[ndim].get() == NULL) {
Validators(runtime)[ndim] = new EtchValidatorBoolean(runtime, ndim);
- CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorBoolean has been created");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getValidatorContext(), "EtchValidatorBoolean has been created");
}
val = Validators(runtime)[ndim];
return ETCH_OK;
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp
index 80b8bbf..12c26b8 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchValidatorByte.h"
#include "support/EtchRuntime.h"
-static const char* TAG = "EtchValidatorByte";
-
capu::SmartPointer<EtchValidator>* EtchValidatorByte::Validators(EtchRuntime* runtime) {
static EtchValidatorCaches validators;
return validators.get(runtime);
@@ -87,13 +85,13 @@
if (validate(value)) {
if ((value->getObjectType()->equals(EtchByte::TYPE())) || (mNDims > 0)) {
result = value;
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorByte", "Object has been validated");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Byte object validation successful");
return ETCH_OK;
} else {
if (value->getObjectType()->equals(EtchShort::TYPE())) {
EtchShort *v = (EtchShort *) value.get();
result = new EtchByte((capu::int8_t)v->get());
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorByte", "Short has been validated by EtchValidatorByte and converted to EtchByte");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Short has been validated by EtchValidatorByte and converted to EtchByte");
return ETCH_OK;
}
@@ -101,7 +99,7 @@
if (value->getObjectType()->equals(EtchLong::TYPE())) {
EtchLong *v = (EtchLong *) value.get();
result = new EtchByte((capu::int8_t)v->get());
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorByte", "EtchLong has been validated by EtchValidatorByte and converted to EtchByte");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "EtchLong has been validated by EtchValidatorByte and converted to EtchByte");
return ETCH_OK;
}
@@ -109,14 +107,14 @@
if (value->getObjectType()->equals(EtchInt32::TYPE())) {
EtchInt32 *v = (EtchInt32 *) value.get();
result = new EtchByte((capu::int8_t)v->get());
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorByte", "EtchInt32 has been validated by EtchValidatorByte and converted to EtchByte");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "EtchInt32 has been validated by EtchValidatorByte and converted to EtchByte");
return ETCH_OK;
}
- CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorByte", "Object has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Byte object validation failed due to unknown type");
return ETCH_ERROR;
}
} else {
- CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorByte", "Object has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Byte object validation failed");
return ETCH_ERROR;
}
}
@@ -131,7 +129,7 @@
}
if (Validators(runtime)[ndim].get() == NULL) {
Validators(runtime)[ndim] = new EtchValidatorByte(runtime, ndim);
- CAPU_LOG_TRACE(runtime->getLogger(), "EtchValidatorByte", "EtchValidatorByte has been created");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getValidatorContext(), "EtchValidatorByte has been created");
}
val = Validators(runtime)[ndim];
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp
index 05e2188..d10a6e5 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchValidatorDouble.h"
#include "support/EtchRuntime.h"
-static const char* TAG = "EtchValidatorDouble";
-
capu::SmartPointer<EtchValidator>* EtchValidatorDouble::Validators(EtchRuntime* runtime) {
static EtchValidatorCaches validators;
return validators.get(runtime);
@@ -68,10 +66,10 @@
status_t EtchValidatorDouble::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
if (validate(value)) {
result = value;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Object has been validated");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Double object validated");
return ETCH_OK;
} else {
- CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Double object validation failed");
return ETCH_ERROR;
}
}
@@ -86,7 +84,7 @@
}
if (Validators(runtime)[ndim].get() == NULL) {
Validators(runtime)[ndim] = new EtchValidatorDouble(runtime, ndim);
- CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorDouble has been created");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getValidatorContext(), "EtchValidatorDouble has been created");
}
val = Validators(runtime)[ndim];
return ETCH_OK;
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp
index c507814..e0c01ed 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchValidatorFloat.h"
#include "support/EtchRuntime.h"
-static const char* TAG = "EtchValidatorFloat";
-
capu::SmartPointer<EtchValidator>* EtchValidatorFloat::Validators(EtchRuntime* runtime) {
static EtchValidatorCaches validators;
return validators.get(runtime);
@@ -68,10 +66,10 @@
status_t EtchValidatorFloat::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
if (validate(value)) {
result = value;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Object has been validated");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Float object validated");
return ETCH_OK;
} else {
- CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Float object validation failed");
return ETCH_ERROR;
}
}
@@ -86,7 +84,7 @@
}
if (Validators(runtime)[ndim].get() == NULL) {
Validators(runtime)[ndim] = new EtchValidatorFloat(runtime, ndim);
- CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorFloat has been created");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getValidatorContext(), "EtchValidatorFloat has been created");
}
val = Validators(runtime)[ndim];
return ETCH_OK;
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp
index a8b7655..ffdb4d4 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchValidatorInt.h"
#include "support/EtchRuntime.h"
-static const char* TAG = "EtchValidatorInt";
-
capu::SmartPointer<EtchValidator>* EtchValidatorInt::Validators(EtchRuntime* runtime) {
static EtchValidatorCaches validators;
return validators.get(runtime);
@@ -81,34 +79,34 @@
if (validate(value)) {
if ((value->getObjectType()->equals(EtchInt32::TYPE())) || (mNDims > 0)) {
result = value;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Object has been validated");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Int has been validated");
return ETCH_OK;
} else {
if (value->getObjectType()->equals(EtchShort::TYPE())) {
EtchShort *v = (EtchShort *) value.get();
result = new EtchInt32((capu::int32_t)v->get());
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "EtchShort has been validated by EtchValidatorInt and converted to EtchInt32");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "EtchShort has been validated by EtchValidatorInt and converted to EtchInt32");
return ETCH_OK;
}
if (value->getObjectType()->equals(EtchByte::TYPE())) {
EtchByte *v = (EtchByte *) value.get();
result = new EtchInt32((capu::int32_t)v->get());
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "EtchByte has been validated by EtchValidatorInt and converted to EtchInt32");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "EtchByte has been validated by EtchValidatorInt and converted to EtchInt32");
return ETCH_OK;
}
if (value->getObjectType()->equals(EtchLong::TYPE())) {
EtchLong *v = (EtchLong *) value.get();
result = new EtchInt32((capu::int32_t)v->get());
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "EtchLong has been validated by EtchValidatorInt and converted to EtchInt32");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "EtchLong has been validated by EtchValidatorInt and converted to EtchInt32");
return ETCH_OK;
}
- CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Int object validation failed due to unknown type");
return ETCH_ERROR;
}
} else {
- CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Int object validation failed");
return ETCH_ERROR;
}
}
@@ -123,7 +121,7 @@
}
if (Validators(runtime)[ndim].get() == NULL) {
Validators(runtime)[ndim] = new EtchValidatorInt(runtime, ndim);
- CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorInt has been created");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getValidatorContext(), "EtchValidatorInt has been created");
}
val = Validators(runtime)[ndim];
return ETCH_OK;
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp
index af01775..0bc9ff2 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchValidatorLong.h"
#include "support/EtchRuntime.h"
-static const char* TAG = "EtchValidatorLong";
-
capu::SmartPointer<EtchValidator>* EtchValidatorLong::Validators(EtchRuntime* runtime) {
static EtchValidatorCaches validators;
return validators.get(runtime);
@@ -75,34 +73,34 @@
if (validate(value)) {
if ((value->getObjectType()->equals(EtchLong::TYPE())) || (mNDims > 0)) {
result = value;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Object has been validated");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Long object has been validated");
return ETCH_OK;
} else {
if (value->getObjectType()->equals(EtchShort::TYPE())) {
EtchShort *v = (EtchShort *) value.get();
result = new EtchLong((capu::int64_t)v->get());
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "EtchShort has been validated by EtchValidatorInt and converted to EtchLong");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "EtchShort has been validated by EtchValidatorInt and converted to EtchLong");
return ETCH_OK;
}
if (value->getObjectType()->equals(EtchByte::TYPE())) {
EtchByte *v = (EtchByte *) value.get();
result = new EtchLong((capu::int64_t)v->get());
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "EtchByte has been validated by EtchValidatorInt and converted to EtchLong");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "EtchByte has been validated by EtchValidatorInt and converted to EtchLong");
return ETCH_OK;
}
if (value->getObjectType()->equals(EtchInt32::TYPE())) {
EtchInt32 *v = (EtchInt32 *) value.get();
result = new EtchLong((capu::int64_t)v->get());
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "EtchInt32 has been validated by EtchValidatorInt and converted to EtchLong");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "EtchInt32 has been validated by EtchValidatorInt and converted to EtchLong");
return ETCH_OK;
}
- CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Long object validation failed due to unknown type");
return ETCH_ERROR;
}
} else {
- CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Long object validation failed");
return ETCH_ERROR;
}
}
@@ -117,7 +115,7 @@
}
if (Validators(runtime)[ndim].get() == NULL) {
Validators(runtime)[ndim] = new EtchValidatorLong(runtime, ndim);
- CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorLong has been created");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getValidatorContext(), "EtchValidatorLong has been created");
}
val = Validators(runtime)[ndim];
return ETCH_OK;
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorNone.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorNone.cpp
index 3a80cf5..a6005f6 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorNone.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorNone.cpp
@@ -48,10 +48,10 @@
status_t EtchValidatorNone::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
if (validate(value)) {
result = value;
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorNone", "NONE has been validated");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "NONE type object has been validated");
return ETCH_OK;
} else {
- CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorNone", "NONE has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "NONE type object validation failed");
return ETCH_ERROR;
}
}
@@ -59,7 +59,7 @@
status_t EtchValidatorNone::Get(EtchRuntime* runtime, capu::SmartPointer<EtchValidator> &val) {
if (Validators(runtime)[0].get() == NULL) {
Validators(runtime)[0] = new EtchValidatorNone(runtime);
- CAPU_LOG_TRACE(runtime->getLogger(), "EtchValidatorNone", "EtchValidatorNone has been created");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getValidatorContext(), "EtchValidatorNone has been created");
}
val = Validators(runtime)[0];
return ETCH_OK;
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp
index ddb1198..f884846 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp
@@ -55,10 +55,10 @@
status_t EtchValidatorObject::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
if (validate(value)) {
result = value;
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorObject", "Object has been validated");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Object validated");
return ETCH_OK;
} else {
- CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorObject", "Object has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Object validation failed");
return ETCH_ERROR;
}
}
@@ -72,7 +72,7 @@
}
//TODO thread safety
if (Validators(runtime)[ndim].get() == NULL) {
- CAPU_LOG_TRACE(runtime->getLogger(), "EtchValidatorObject", "EtchValidatorObject has been created");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getValidatorContext(), "EtchValidatorObject has been created");
Validators(runtime)[ndim] = new EtchValidatorObject(runtime, ndim);
}
val = Validators(runtime)[ndim];
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorRuntimeException.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorRuntimeException.cpp
index 0b1d761..bd0b034 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorRuntimeException.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorRuntimeException.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchValidatorRuntimeException.h"
#include "support/EtchRuntime.h"
-static const char* TAG = "EtchValidatorRuntimeException";
-
capu::SmartPointer<EtchValidator>* EtchValidatorRuntimeException::Validators(EtchRuntime* runtime) {
static EtchValidatorCaches validators;
return validators.get(runtime);
@@ -52,10 +50,10 @@
status_t EtchValidatorRuntimeException::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
if (validate(value)) {
result = value;
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorRuntimeException", "EtchRuntimeException has been validated");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "EtchRuntimeException validated");
return ETCH_OK;
} else {
- CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorRuntimeException", "EtchRuntimeException has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "EtchRuntimeException object validation failed");
return ETCH_ERROR;
}
}
@@ -63,7 +61,7 @@
status_t EtchValidatorRuntimeException::Get(EtchRuntime* runtime, capu::SmartPointer<EtchValidator> &val) {
if (Validators(runtime)[0].get() == NULL) {
Validators(runtime)[0] = new EtchValidatorRuntimeException(runtime);
- CAPU_LOG_TRACE(runtime->getLogger(), "EtchValidatorRuntimeException", "EtchValidatorRuntimeException has been created");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getValidatorContext(),"EtchValidatorRuntimeException has been created");
}
val = Validators(runtime)[0];
return ETCH_OK;
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp
index 50f3481..fb3fb28 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchValidatorShort.h"
#include "support/EtchRuntime.h"
-static const char* TAG = "EtchValidatorShort";
-
capu::SmartPointer<EtchValidator>* EtchValidatorShort::Validators(EtchRuntime* runtime) {
static EtchValidatorCaches validators;
return validators.get(runtime);
@@ -83,35 +81,35 @@
if (validate(value)) {
if ((value->getObjectType()->equals(EtchShort::TYPE())) || (mNDims > 0)) {
result = value;
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorShort", "Object has been validated");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Short Object has been validated");
return ETCH_OK;
} else {
if (value->getObjectType()->equals(EtchInt32::TYPE())) {
EtchInt32 *v = (EtchInt32 *) value.get();
result = new EtchShort((capu::int16_t)v->get());
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorShort", "EtchInt32 has been validated by EtchValidatorInt and converted to EtchShort");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "EtchInt32 has been validated by EtchValidatorInt and converted to EtchShort");
return ETCH_OK;
}
if (value->getObjectType()->equals(EtchByte::TYPE())) {
EtchByte *v = (EtchByte *) value.get();
result = new EtchShort((capu::int16_t)v->get());
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorShort", "EtchByte has been validated by EtchValidatorInt and converted to EtchShort");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "EtchByte has been validated by EtchValidatorInt and converted to EtchShort");
return ETCH_OK;
}
if (value->getObjectType()->equals(EtchLong::TYPE())) {
EtchLong *v = (EtchLong *) value.get();
result = new EtchShort((capu::int16_t)v->get());
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorShort", "EtchLong has been validated by EtchValidatorInt and converted to EtchShort");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "EtchLong has been validated by EtchValidatorInt and converted to EtchShort");
return ETCH_OK;
}
- CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorShort", "Object has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Short object validation failed due to unknown type");
return ETCH_ERROR;
}
} else {
- CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorShort", "Object has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Short object validation failed");
return ETCH_ERROR;
}
}
@@ -125,7 +123,7 @@
return ETCH_OK;
}
if (Validators(runtime)[ndim].get() == NULL) {
- CAPU_LOG_TRACE(runtime->getLogger(), "EtchValidatorShort", "EtchValidatorShort has been created");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getValidatorContext(), "EtchValidatorShort has been created");
Validators(runtime)[ndim] = new EtchValidatorShort(runtime, ndim);
}
val = Validators(runtime)[ndim];
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp
index 115f3bf..706af3c 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchValidatorString.h"
#include "support/EtchRuntime.h"
-static const char* TAG = "EtchValidatorString";
-
capu::SmartPointer<EtchValidator>* EtchValidatorString::Validators(EtchRuntime* runtime) {
static EtchValidatorCaches validators;
return validators.get(runtime);
@@ -66,10 +64,10 @@
status_t EtchValidatorString::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
if (validate(value)) {
result = value;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "String has been validated");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "String object validated");
return ETCH_OK;
} else {
- CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "String has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "String object validation failed");
return ETCH_ERROR;
}
}
@@ -84,7 +82,7 @@
}
if (Validators(runtime)[ndim].get() == NULL) {
Validators(runtime)[ndim] = new EtchValidatorString(runtime, ndim);
- CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorString has been created");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getValidatorContext(), "EtchValidatorString has been created");
}
val = Validators(runtime)[ndim];
return ETCH_OK;
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorStructValue.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorStructValue.cpp
index 43c2143..f709ece 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorStructValue.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorStructValue.cpp
@@ -19,8 +19,6 @@
#include "serialization/EtchValidatorStructValue.h"
#include "support/EtchRuntime.h"
-static char* TAG = "EtchValidatorStructValue";
-
const EtchObjectType* EtchValidatorStructValue::TYPE() {
const static EtchObjectType TYPE(EOTID_VALIDATOR_STRUCT_VALUE, NULL);
return &TYPE;
@@ -42,10 +40,10 @@
status_t EtchValidatorStructValue::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
if (validate(value)) {
result = value;
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Object has been validated");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Struct object has been validated");
return ETCH_OK;
} else {
- CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getValidatorContext(), "Struct object validation failed");
return ETCH_ERROR;
}
}
@@ -79,7 +77,7 @@
if (ndim > MAX_NDIMS) {
return ETCH_EINVAL;
}
- CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorShort has been created");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getValidatorContext(), "EtchValidatorShort has been created");
val = capu::SmartPointer <EtchValidator > (new EtchValidatorStructValue(runtime, type, ndim));
return ETCH_OK;
}
diff --git a/binding-cpp/runtime/src/main/support/EtchRemoteBase.cpp b/binding-cpp/runtime/src/main/support/EtchRemoteBase.cpp
index 3ae95f7..ea39c24 100644
--- a/binding-cpp/runtime/src/main/support/EtchRemoteBase.cpp
+++ b/binding-cpp/runtime/src/main/support/EtchRemoteBase.cpp
@@ -22,8 +22,6 @@
#include "util/EtchLogger.h"
#include "support/EtchStackClient.h"
-static char* TAG = "EtchRemoteBase";
-
EtchRemoteBase::EtchRemoteBase(EtchRuntime* runtime, EtchDeliveryService* svc, EtchValueFactory* vf, EtchStack* stack)
: mRuntime(runtime), mSvc(svc), mVf(vf), mStack(stack) {
}
@@ -49,12 +47,12 @@
}
status_t EtchRemoteBase::begincall(capu::SmartPointer<EtchMessage> msg, EtchMailbox *&result) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Begin call for the message is initiated");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Begin call for the message is initiated");
return mSvc->begincall(msg, result);
}
status_t EtchRemoteBase::endcall(EtchMailbox* mb, EtchType* responseType, capu::SmartPointer<EtchObject> &result) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "End call for the message is initiated");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "End call for the message is initiated");
return mSvc->endcall(mb, responseType, result);
}
diff --git a/binding-cpp/runtime/src/main/support/EtchRuntime.cpp b/binding-cpp/runtime/src/main/support/EtchRuntime.cpp
index 30000cd..e1f7ef7 100644
--- a/binding-cpp/runtime/src/main/support/EtchRuntime.cpp
+++ b/binding-cpp/runtime/src/main/support/EtchRuntime.cpp
@@ -19,13 +19,17 @@
#include "common/EtchRuntimeException.h"
#include "support/EtchRuntime.h"
#include "support/EtchTransportHelper.h"
-#include "util/EtchLogger.h"
+#include "capu/util/LogLevel.h"
EtchRuntime::EtchRuntime()
- : mIsClosed(false) {
+ : mIsClosed(false)
+ , mLogger(mLogAppender)
+{
mMutex.lock();
mId = getNextId();
mMutex.unlock();
+
+ mLogger.setLogLevel(capu::ELogLevel::LL_ALL);
}
EtchRuntime::~EtchRuntime() {
@@ -97,4 +101,4 @@
EtchLogger& EtchRuntime::getLogger() {
return mLogger;
-}
+}
\ No newline at end of file
diff --git a/binding-cpp/runtime/src/main/support/EtchTransportHelper.cpp b/binding-cpp/runtime/src/main/support/EtchTransportHelper.cpp
index fd6d773..f7aaaf8 100644
--- a/binding-cpp/runtime/src/main/support/EtchTransportHelper.cpp
+++ b/binding-cpp/runtime/src/main/support/EtchTransportHelper.cpp
@@ -64,7 +64,7 @@
resources->put( EtchTransportHelper::FREE_POOL(), obj, objOld);
}
result = resources;
- CAPU_LOG_TRACE(runtime->getLogger(), "EtchTransportHelper", "Resources and pools have been allocated initialized");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getRuntimeContext(), "Resources and pools have been allocated initialized");
return ETCH_OK;
}
@@ -98,7 +98,7 @@
//delete resource
delete resources;
- CAPU_LOG_TRACE(runtime->getLogger(), "EtchTransportHelper", "Resources and pools have been deallocated");
+ ETCH_LOG_TRACE(runtime->getLogger(), runtime->getLogger().getRuntimeContext(), "Resources and pools have been deallocated");
return ETCH_OK;
}
}
diff --git a/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp b/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp
index f7ebc01..d1a0d14 100644
--- a/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp
@@ -22,8 +22,6 @@
#include "support/EtchRuntime.h"
#include "util/EtchLogger.h"
-static char* TAG = "EtchDefaultDeliveryService";
-
const EtchString& EtchDefaultDeliveryService::DISABLE_TIMEOUT() {
static const EtchString name("DefaultDeliveryService.disableTimeout");
return name;
@@ -95,12 +93,12 @@
}
status_t EtchDefaultDeliveryService::sessionMessage(capu::SmartPointer<EtchWho> sender, capu::SmartPointer<EtchMessage> msg) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Message will be passed to StubBase to execute the respective remote call");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Message will be passed to StubBase to execute the respective remote call");
return mSession->sessionMessage(sender, msg);
}
status_t EtchDefaultDeliveryService::transportMessage(capu::SmartPointer<EtchWho> recipient, capu::SmartPointer<EtchMessage> message) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Result of respective remote call will be passed to Mailbox Manager");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Result of respective remote call will be passed to Mailbox Manager");
return mTransport->transportMessage(recipient, message);
}
@@ -144,7 +142,7 @@
}
status_t EtchDefaultDeliveryService::begincall(capu::SmartPointer<EtchMessage> msg, EtchMailbox*& result) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Begin call for the message has been initiated");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Begin call for the message has been initiated");
return mTransport->transportCall(NULL, msg, result);
}
@@ -155,20 +153,20 @@
//get message from mailbox
EtchMailbox::EtchElement* mbe = NULL;
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "End call for the message starts");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "End call for the message starts");
status_t res = mb->read(mbe, timeout);
if (res != ETCH_OK) {
mb->closeRead();
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Error on mailbox read, might be caused by timeout");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Error on mailbox read, might be caused by timeout");
//TODO: Add error handling
return res;
}
- CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "We got a message in the mailbox");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "We got a message in the mailbox");
//get reply message and responseType
capu::SmartPointer<EtchMessage> rmsg = mbe->mMsg;
if (!rmsg->isType(responseType)) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Error on response Type");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Error on response Type");
mb->closeRead();
rmsg->clear();
delete mbe;
@@ -182,12 +180,12 @@
if (err == ETCH_ENOT_EXIST) {
//void return value
mb->closeRead();
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "End call for the message is completed");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "End call for the message is completed");
return ETCH_OK;
} else if (err != ETCH_OK) {
mb->closeRead();
rmsg->clear();
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Error on getting respective field on message structure");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "Error on getting respective field on message structure");
delete mbe;
return ETCH_ERROR;
}
@@ -197,7 +195,7 @@
delete mbe;
result = r;
mb->closeRead();
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "End call for the message is completed");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(), "End call for the message is completed");
return ETCH_OK;
}
diff --git a/binding-cpp/runtime/src/main/transport/EtchMessagizer.cpp b/binding-cpp/runtime/src/main/transport/EtchMessagizer.cpp
index 879f3b0..becc73f 100644
--- a/binding-cpp/runtime/src/main/transport/EtchMessagizer.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchMessagizer.cpp
@@ -18,8 +18,6 @@
#include "transport/EtchMessagizer.h"
#include "support/EtchRuntime.h"
-static char* TAG = "EtchMessagizer";
-
const EtchString& EtchMessagizer::FORMAT(){
static const EtchString name("Messagizer.format");
return name;
@@ -96,10 +94,10 @@
capu::SmartPointer<EtchMessage> message;
result = mTdi->readMessage(buf, message);
if (result != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Deserialization of messages has been failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getMessagizerContext(), "Deserialization of messages has been failed");
return result;
}
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Message has been deserialized and passed to the Mailbox Manager");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getMessagizerContext(), "Message has been deserialized and passed to the Mailbox Manager");
result = mSession->sessionMessage(sender, message);
if (result != ETCH_OK) {
EtchString errmsg("Unwanted Message");
@@ -129,12 +127,12 @@
}
result = mTdo->writeMessage(message, msgBuf);
if (result != ETCH_OK){
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of messages has been failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getMessagizerContext(), "Serialization of messages has been failed");
mutex.unlock();
return result;
}
msgBuf->setIndex(0);
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Serialized message has been sent to the Packetizer");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getMessagizerContext(), "Serialized message has been sent to the Packetizer");
result = mTransport->transportPacket(recipient, msgBuf);
if (result != ETCH_OK) {
mutex.unlock();
diff --git a/binding-cpp/runtime/src/main/transport/EtchPacketizer.cpp b/binding-cpp/runtime/src/main/transport/EtchPacketizer.cpp
index 7f4404c..449dab1 100644
--- a/binding-cpp/runtime/src/main/transport/EtchPacketizer.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchPacketizer.cpp
@@ -19,8 +19,6 @@
#include "transport/EtchPacketizer.h"
#include "support/EtchRuntime.h"
-static const char* TAG = "EtchPacketizer";
-
const capu::uint32_t& EtchPacketizer::HEADER_SIZE() {
static const capu::uint32_t headerSize(8);
return headerSize;
@@ -131,7 +129,7 @@
buf->putInt(EtchPacketizer::SIG());
buf->putInt(pktSize);
buf->setIndex(index);
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Header is constructed and raw data has been sent to Transport for transmission");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getPacketizerContext(), "Header is constructed and raw data has been sent to Transport for transmission");
return mTransport->transportData(recipient, buf);
}
@@ -196,7 +194,7 @@
capu::uint32_t length = buf->getLength();
capu::uint32_t index = buf->getIndex();
buf->setLength(index + mBodyLen);
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Header is parsed and the body of message is sent to Messagizer");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getPacketizerContext(), "Entire body is in buffer: header is parsed and the body of message is sent to Messagizer");
result = mSession->sessionPacket(sender, buf);
if (result != ETCH_OK) {
@@ -215,7 +213,7 @@
mSavedBuf->put(*buf, needFromBuf);
mSavedBuf->setIndex(0);
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Header is parsed and the body of message is sent to Messagizer");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getPacketizerContext(), "more data in buffer: header is parsed and the body of message is sent to Messagizer");
mSession->sessionPacket(sender, mSavedBuf);
mSavedBuf->reset();
@@ -239,7 +237,7 @@
buf->getInteger(sig);
if (sig != SIG()) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "SIG is not correct, message will be discarded");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getPacketizerContext(), "SIG is not correct, message will be discarded");
return ETCH_ERROR;
}
@@ -249,7 +247,7 @@
buf->reset();
if (pktSize > mMaxPktSize) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Packet size exceeds the maximum packet size, message will be discarded");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getPacketizerContext(), "Packet size exceeds the maximum packet size, message will be discarded");
return ETCH_ERROR;
}
return ETCH_OK;
diff --git a/binding-cpp/runtime/src/main/transport/EtchPlainMailboxManager.cpp b/binding-cpp/runtime/src/main/transport/EtchPlainMailboxManager.cpp
index 67b4a25..c824f14 100644
--- a/binding-cpp/runtime/src/main/transport/EtchPlainMailboxManager.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchPlainMailboxManager.cpp
@@ -65,7 +65,7 @@
mMailboxes.put(msgid, mb);
mMutex.unlock();
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchPlainMailboxManager", "A new mailbox is registered");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getMailboxContext(), "A new mailbox is registered");
return ETCH_OK;
}
@@ -87,16 +87,16 @@
capu::int64_t msgid;
if(msg->getInReplyToMessageId(msgid) == ETCH_OK) {
EtchMailbox* mb = NULL;
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchPlainMailboxManager", "A message has been received as answer to message identified by %d", msgid);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getMailboxContext(), "A message has been received as answer to message identified by msgid " << msgid);
if (getMailbox(msgid, mb) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchPlainMailboxManager", "Unable to get Mailbox");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getMailboxContext(), "Unable to get Mailbox fro msgid " << msgid);
return ETCH_ERROR;
}
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchPlainMailboxManager", "Message has been sent to respective mailbox");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getMailboxContext(), "Message has been sent to respective mailbox");
return mb->message(sender, msg);
}
// no msgid - pass off to session
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchPlainMailboxManager", "Message has been sent to upper layer directly");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getMailboxContext(), "Message has been sent to upper layer directly as no msgid was given");
return mSession->sessionMessage(sender, msg);
}
@@ -117,15 +117,15 @@
return ETCH_ERROR;
}
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchPlainMailboxManager", "A mailbox has been created for message id %d", msgid);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getMailboxContext(), "A mailbox has been created for msgid " << msgid);
EtchMailbox *mb = new EtchPlainMailbox(this, msgid);
if (registerMailbox(mb) != ETCH_OK) {
delete mb;
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getMailboxContext(), "Mailbox registration failed");
return ETCH_ERROR;
- CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchPlainMailboxManager", "Registration has been failed");
}
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchPlainMailboxManager", "Message has been sent to Messagizer with registering a respective mailbox");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getMailboxContext(), "Message sending to Messagizer and registering a respective mailbox");
if (mTransport->transportMessage(recipient, msg) == ETCH_OK) {
result = mb;
return ETCH_OK;
@@ -146,7 +146,7 @@
if(message->setMessageId(mIdGen.next()) != ETCH_OK) {
return ETCH_ERROR;
}
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchPlainMailboxManager", "Message has been sent to Messagizer without registering a mailbox");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getMailboxContext(), "Message has been sent to Messagizer without registering a mailbox");
return mTransport->transportMessage(recipient, message);
}
@@ -175,7 +175,7 @@
status_t EtchPlainMailboxManager::sessionNotify(capu::SmartPointer<EtchObject> event) {
if (event->equals(&EtchSession::UP())) {
mUp = true;
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchPlainMailboxManager", "Connection is up");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getMailboxContext(), "Connection is up");
} else if (event->equals(&EtchSession::DOWN())) {
mUp = false;
// TODO check thread safety
@@ -186,7 +186,7 @@
entry.value->closeDelivery();
delete entry.value;
}
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchPlainMailboxManager", "Connection is down");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getMailboxContext(), "Connection is down");
}
status_t status;
if(mSession != NULL) {
diff --git a/binding-cpp/runtime/src/main/transport/EtchTcpConnection.cpp b/binding-cpp/runtime/src/main/transport/EtchTcpConnection.cpp
index 398823f..2db3f7a 100644
--- a/binding-cpp/runtime/src/main/transport/EtchTcpConnection.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchTcpConnection.cpp
@@ -53,10 +53,10 @@
status_t EtchTcpConnection::send(capu::int8_t* buf, capu::uint32_t off, capu::uint32_t len) {
if (mSocket != NULL) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%d byte of data has been transmitted", len);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), len << "byte of data has been transmitted");
return mSocket->send((capu::char_t*)&buf[off], len);
}
- CAPU_LOG_WARN(mRuntime->getLogger(), "EtchTcpConnection", "%d byte of data has not been transmitted because there is no connection", len);
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), len << "byte of data has not been transmitted because there is no connection");
return ETCH_ERROR;
}
@@ -67,17 +67,17 @@
capu::int32_t n;
status_t result = mSocket->receive((capu::char_t*)buf->getBuffer(), buf->getSize(), n);
if (result != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Receive() failed with error code %d", mHost.c_str(), mPort, result);
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Receive() failed with error code " << result);
return result;
}
if (n <= 0) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Connection closed for stack", mHost.c_str(), mPort);
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort <<" => Connection closed for stack");
return ETCH_ERROR;
}
buf->setLength(n);
buf->setIndex(0);
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => %d byte data has been received and passed to Packetizer", mHost.c_str(), mPort, n);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => " << n << "bytes have been received and passed to Packetizer");
mSession->sessionData(NULL, buf);
}
return ETCH_OK;
@@ -128,7 +128,7 @@
}
if (mSocket->connect((capu::char_t*) mHost.c_str(), mPort) == ETCH_OK) {
mMutexConnection.unlock();
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Connection established", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Connection established");
return ETCH_OK;
} else {
mSocket->close();
@@ -136,7 +136,7 @@
mSocket = NULL;
first = false;
}
- CAPU_LOG_WARN(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Connection could not be established for stack %d", mHost.c_str(), mPort);
+ ETCH_LOG_WARN(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Connection could not be established");
}
mMutexConnection.unlock();
@@ -162,14 +162,14 @@
mMutex.lock();
if (mIsStarted) {
mMutex.unlock();
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Start command received and EtchTcpConnection Receiving Thread", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Start command received and EtchTcpConnection Receiving Thread");
return ETCH_OK;
}
mIsStarted = true;
mMutex.unlock();
mThread = new capu::Thread();
mThread->start(*this);
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Start command received and EtchTcpConnection Receiving Thread has started", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Start command received and EtchTcpConnection Receiving Thread has started");
return ETCH_OK;
}
@@ -177,14 +177,14 @@
mMutex.lock();
if (mIsStarted) {
mMutex.unlock();
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Start and wait command received, but already started", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Start and wait command received, but already started");
return ETCH_OK;
}
mIsStarted = true;
mMutex.unlock();
mThread = new capu::Thread();
mThread->start(*this);
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Start and wait command received and EtchTcpConnection Receiving Thread has started", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Start and wait command received and EtchTcpConnection Receiving Thread has started");
return waitUp(((EtchInt32*) value.get())->get());
}
@@ -192,11 +192,11 @@
mMutex.lock();
if (!mIsStarted) {
mMutex.unlock();
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Stop command received, but already stopped", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Stop command received, but already stopped");
return ETCH_OK;
}
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Stop command received and Stop flag for receiving thread is set", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Stop command received and Stop flag for receiving thread is set");
mIsStarted = false;
mMutex.unlock();
@@ -208,11 +208,11 @@
mMutex.lock();
if (!mIsStarted) {
mMutex.unlock();
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Stop and wait command received, but already stopped", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Stop and wait command received, but already stopped");
return ETCH_OK;
}
mIsStarted = false;
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Stop and wait command received and Stop flag for receiving thread is set", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Stop and wait command received and Stop flag for receiving thread is set");
mMutex.unlock();
close();
@@ -223,13 +223,13 @@
mMutex.lock();
if (!mIsStarted) {
mMutex.unlock();
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Reset command received, but no connection established yet", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Reset command received, but no connection established yet");
return ETCH_OK;
}
mIsStarted = false;
mMutex.unlock();
close();
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Reset command received and the receiving thread has been restarted", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Reset command received and the receiving thread has been restarted");
return ETCH_OK;
}
return ETCH_ENOT_SUPPORTED;
@@ -245,7 +245,7 @@
status_t EtchTcpConnection::close() {
if (mSocket != NULL) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Socket has been closed", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Socket has been closed");
return mSocket->close();
} else {
return ETCH_ERROR;
@@ -269,23 +269,23 @@
status = openSocket(!first);
if (status != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Socket has not been successfully opened", mHost.c_str(), mPort);
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Socket has not been successfully opened");
break;
}
status = setupSocket();
if (status != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Socket has not been successfully opened", mHost.c_str(), mPort);
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Socket has not been successfully opened");
close();
break;
}
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Socket has been opened and connection has been successfully established and start reading", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Socket has been opened and connection has been successfully established and start reading");
fireUp();
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => FireUp was send to the Stack", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => FireUp was send to the Stack");
status = readSocket();
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Connection closing", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Connection closing");
fireDown();
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => FireDown was send to the Stack", mHost.c_str(), mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => FireDown was send to the Stack");
close();
first = false;
}
@@ -295,22 +295,22 @@
status_t EtchTcpConnection::setupSocket() {
if (mOptions.getBufferSize() != 0) {
if (mSocket->setBufferSize(mOptions.getBufferSize()) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => setupSocket: Error while setting buffer size", mHost.c_str(), mPort);
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => setupSocket: Error while setting buffer size");
return ETCH_ERROR;
}
}
if (mSocket->setKeepAlive((mOptions.getKeepAlive() != 0)) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => setupSocket: Error while setting keep alive", mHost.c_str(), mPort);
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => setupSocket: Error while setting keep alive");
return ETCH_ERROR;
}
if (mSocket->setLingerOption((mOptions.getLingerTime() >= 0), mOptions.getLingerTime()) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => setupSocket: Error while setting linger time", mHost.c_str(), mPort);
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => setupSocket: Error while setting linger time");
return ETCH_ERROR;
}
if (mSocket->setNoDelay((mOptions.getNoDelay() != 0)) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => setupSocket: Error while setting delay", mHost.c_str(), mPort);
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => setupSocket: Error while setting delay");
return ETCH_ERROR;
}
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Settings for socket has been successfully configured", mHost.c_str(), mPort);
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), mHost.c_str() << ":" << mPort << " => Settings for socket has been successfully configured");
return ETCH_OK;
}
diff --git a/binding-cpp/runtime/src/main/transport/EtchTcpListener.cpp b/binding-cpp/runtime/src/main/transport/EtchTcpListener.cpp
index 9714a0b..b34153e 100644
--- a/binding-cpp/runtime/src/main/transport/EtchTcpListener.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchTcpListener.cpp
@@ -122,20 +122,21 @@
}
if (mSocket->bind(mPort) == ETCH_OK) {
if (mSocket->listen(mBackLog) == ETCH_OK) {
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Listener socket opened successfully on port " << mPort);
mMutexConnection.unlock();
return ETCH_OK;
} else {
mSocket->close();
delete mSocket;
mSocket = NULL;
- CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpListener", "Listening on specified port has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Listening on specified port " << mPort << " has failed");
}
} else {
delete mSocket;
mSocket = NULL;
- CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpListener", "Binding to specified port has failed");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Binding to specified port " << mPort << " has failed");
}
- //LOGGER IS NEEDED
+
}
mMutexConnection.unlock();
return ETCH_ERROR;
@@ -148,7 +149,7 @@
if (s == NULL)
break;
if (mSession != NULL) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "A connection has been accepted");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "A connection has been accepted");
mSession->sessionAccepted(s);
} else {
delete s;
@@ -162,7 +163,7 @@
if (control->equals(&EtchTcpListener::START())) {
if (mIsStarted) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Start command received, but already started - port is %d", mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Ignoring START command received as listener is already started - port is " << mPort);
return ETCH_OK;
}
mMutex.lock();
@@ -173,13 +174,13 @@
mConnectionChecker = new ConnectionChecker(this);
mConnectionCheckerThread = new capu::Thread();
mConnectionCheckerThread->start(*mConnectionChecker);
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Start command received and EtchTcpListener starts listening on port %d", mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Start command received and EtchTcpListener starts listening on port " << mPort);
return ETCH_OK;
}
if (control->equals(&EtchTcpListener::START_AND_WAIT_UP())) {
if (mIsStarted) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Start and wait up command received, but already started - port is %d", mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Ignoring START_AND_WAIT_UP command received as listener is already started - port is " << mPort);
return ETCH_OK;
}
mMutex.lock();
@@ -190,17 +191,17 @@
mConnectionChecker = new ConnectionChecker(this);
mConnectionCheckerThread = new capu::Thread();
mConnectionCheckerThread->start(*mConnectionChecker);
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Start and wait up command received and EtchTcpListener starts listening on port %d", mPort);
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Start and wait up command received and EtchTcpListener starts listening on port " << mPort);
return waitUp(((EtchInt32*) value.get())->get());
}
if (control->equals(&EtchTcpListener::STOP())) {
if (!mIsStarted) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Stop command received, but already stopped");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Ignoring STOP command as listener is already stopped");
return ETCH_OK;
}
mMutex.lock();
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Stop command received and EtchTcpListener sets the stop flag");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Stop command received and EtchTcpListener sets the stop flag");
mIsStarted = false;
mMutex.unlock();
close();
@@ -209,20 +210,20 @@
if (control->equals(&EtchTcpListener::STOP_AND_WAIT_DOWN())) {
if (!mIsStarted) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Stop and wait command received and EtchTcpListener, but already stopped");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Stop and wait command received and EtchTcpListener, but already stopped");
}
mMutex.lock();
mIsStarted = false;
mMutex.unlock();
close();
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Stop and wait command received and EtchTcpListener sets the stop flag");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Stop and wait command received and EtchTcpListener sets the stop flag");
status_t ret = waitDown(((EtchInt32*) value.get())->get());
return ret;
}
if (control->equals(&EtchTcpListener::RESET())) {
if (!mIsStarted) {
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Reset command received - but listener is not started yet.");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Reset command received - but listener is not started yet.");
return ETCH_OK;
}
mMutex.lock();
@@ -233,7 +234,7 @@
mIsStarted = true;
mThread = new capu::Thread();
mThread->start(*this);
- CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Reset command received and EtchTcpListener has been restarted the stop flag");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Reset command received and EtchTcpListener has been restarted the stop flag");
return ETCH_OK;
}
return ETCH_ENOT_SUPPORTED;
@@ -263,18 +264,18 @@
while (mIsStarted) {
if (openSocket(first) != ETCH_OK) {
- CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpListener", "Socket has not been created");
+ ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Socket cannot be opened");
break;
}
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchTcpListener", "Socket has been created");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "Socket has been created");
fireUp();
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchTcpListener", "FireUp was send to the Stack");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "FireUp was send to the Stack");
if (readSocket() != ETCH_OK) {
close();
break;
}
fireDown();
- CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchTcpListener", "FireDown was send to the Stack");
+ ETCH_LOG_TRACE(mRuntime->getLogger(), mRuntime->getLogger().getTransportContext(), "FireDown was send to the Stack");
close();
first = false;
}
diff --git a/binding-cpp/runtime/src/main/transport/EtchTcpTransportFactory.cpp b/binding-cpp/runtime/src/main/transport/EtchTcpTransportFactory.cpp
index 491b059..763742c 100644
--- a/binding-cpp/runtime/src/main/transport/EtchTcpTransportFactory.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchTcpTransportFactory.cpp
@@ -19,8 +19,6 @@
#include "support/EtchStackServer.h"
#include "transport/EtchTcpTransportFactory.h"
-static const char* TAG = "EtchTcpTransportFactory";
-
const EtchString& EtchTcpTransportFactory::SOCKET() {
static const EtchString name("TcpTransportFactory.socket");
return name;
@@ -247,7 +245,7 @@
delete stack;
return status;
}
- CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "New stack for the accepted connection has been created");
+ ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getMailboxContext(), "New communication stack for the accepted connection has been created");
return mSession->newServer(mRuntime, m, mUri, res);
}