#include "CalendarUtility.h"
-
-#include <dpl/log/log.h>
-
#include <unicode/ucal.h>
#include <unicode/ustring.h>
#include <unicode/ustdio.h>
#include <unicode/udat.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Calendar {
_tzid = (UChar*)calloc(strlen(tzid) + 1, sizeof(UChar));
if (_tzid == NULL)
{
- LogError("Failed to calloc");
+ LoggerE("Failed to calloc");
return ct;
}
u_uastrcpy(_tzid, tzid);
- LogDebug("tzid: "<<tzid);
+ LoggerD("tzid: "<<tzid);
ucal = ucal_open(_tzid, u_strlen(_tzid), "en_US", UCAL_TRADITIONAL, &status);
if (U_FAILURE(status)) {
- LogError("ucal_open failed with "<<u_errorName(status));
+ LoggerE("ucal_open failed with "<<u_errorName(status));
return ct;
}
ucal_setMillis(ucal, sec2ms(lli), &status);
if (U_FAILURE(status)) {
- LogError("ucal_setMillis failed with "<<u_errorName(status));
+ LoggerE("ucal_setMillis failed with "<<u_errorName(status));
return ct;
}
ct.time.date = {y, mon, d};
- LogDebug("y: "<<y<<", mon: "<<mon<<", d: "<<d);
+ LoggerD("y: "<<y<<", mon: "<<mon<<", d: "<<d);
ucal_close(ucal);
if (_tzid) free(_tzid);
_tzid = (UChar*)calloc(strlen(tzid) + 1, sizeof(UChar));
if (_tzid == NULL)
{
- LogError("Failed to calloc");
+ LoggerE("Failed to calloc");
return -1;
}
u_uastrcpy(_tzid, tzid);
- LogDebug("tzid: "<<tzid);
+ LoggerD("tzid: "<<tzid);
ucal = ucal_open(_tzid, u_strlen(_tzid), "en_US", UCAL_TRADITIONAL, &status);
if (U_FAILURE(status)) {
- LogError("ucal_open failed with "<<u_errorName(status));
+ LoggerE("ucal_open failed with "<<u_errorName(status));
return -1;
}
ucal_close(ucal);
if (_tzid) free(_tzid);
- LogDebug("converted time: "<<lli);
+ LoggerD("converted time: "<<lli);
return lli;
}