//
#include <pcrecpp.h>
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "IMessage.h"
#include "EventSendMessage.h"
#include "EventMessagingService.h"
+#include <Logger.h>
using namespace std;
m_requestReceiver(NULL),
m_sendMessageEvent(NULL)
{
- LogDebug("message creation, msgId=" << m_id << ", msgType=" << m_msgType);
+ LoggerD("message creation, msgId=" << m_id << ", msgType=" << m_msgType);
//initialize dateTime of message
time_t rawtime;
if (local) {
m_dateTime = *local;
} else {
- LogError("Failed to initialize message dateTime");
+ LoggerE("Failed to initialize message dateTime");
}
}
IMessage::~IMessage()
{
- LogDebug("destroying message, msgId=" << m_id << ", msgType=" << m_msgType);
+ LoggerD("destroying message, msgId=" << m_id << ", msgType=" << m_msgType);
}
string IMessage::getId() const
string IMessage::getCurrentUserFolder() const
{
if (m_folder != USERDEFINED_FOLDER) {
- LogError("folder is not user folder type");
+ LoggerE("folder is not user folder type");
Throw(WrtDeviceApis::Commons::UnknownException);
}
return m_userFolderName;
bool IMessage::validatePhoneNumber(std::string& number)
{
- LogDebug("testing number=" << number);
+ LoggerD("testing number=" << number);
return true;
/*
pcrecpp::RE re("[^0-9#\\+\\*]?");
re.GlobalReplace("", &number); //remove invailde phone number. phone Number were composed only number.
if (number.empty()) {
- LogError("wrong phoneNumber=" << number);
+ LoggerE("wrong phoneNumber=" << number);
return false;
}
- LogDebug("phoneNumber=" << number);
+ LoggerD("phoneNumber=" << number);
pcrecpp::RE re2("^[+#]?[0-9]{1,22}$");
if (re2.FullMatch(number)) {
- LogDebug("vaildate Number=" << number);
+ LoggerD("vaildate Number=" << number);
return true;
}
else
{
- LogDebug("invaildate Number=" << number);
+ LoggerD("invaildate Number=" << number);
return false;
}
*/
{
for (size_t i = 0; i < addr.getRecipientSize(); i++) {
if (false == validateEmailAddr(addr.getRecipient(i))) {
- LogError("wrong email address");
+ LoggerE("wrong email address");
return false;
}
}
".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"
);
if (re.FullMatch(email)) {
- LogDebug("emailAddress=" << email);
+ LoggerD("emailAddress=" << email);
return true;
}
- LogError("wrong emailAddress=" << email);
+ LoggerE("wrong emailAddress=" << email);
return false;
}
void IMessage::setMessageStatus( MessageStatus status)
{
- LogDebug("setMessageStatus : " << status);
+ LoggerD("setMessageStatus : " << status);
m_msgStatus = status;
}