summaryrefslogtreecommitdiffstats
path: root/src/utils/logger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/logger.cpp')
-rw-r--r--src/utils/logger.cpp57
1 files changed, 1 insertions, 56 deletions
diff --git a/src/utils/logger.cpp b/src/utils/logger.cpp
index 0504195..d3f8241 100644
--- a/src/utils/logger.cpp
+++ b/src/utils/logger.cpp
@@ -22,10 +22,9 @@
#include "logger.h"
#include "common/resourcemanager.h"
#include "utils/string.h"
+#include "utils/time.h"
-#include <ctime>
#include <fstream>
-#include <iomanip>
#include <iostream>
#ifdef WIN32
@@ -60,60 +59,6 @@ static std::string mLastCallDate = "";
static std::string mOldDate = "";
/**
- * Gets the current time.
- *
- * @return the current time as string.
- */
-static std::string getCurrentTime()
-{
- time_t now;
- tm local;
-
- // Get current time_t value
- time(&now);
-
- // Convert time_t to tm struct to break the time into individual
- // constituents.
- local = *(localtime(&now));
-
- // Stringify the time, the format is: hh:mm:ss
- using namespace std;
- ostringstream os;
- os << setw(2) << setfill('0') << local.tm_hour
- << ":" << setw(2) << setfill('0') << local.tm_min
- << ":" << setw(2) << setfill('0') << local.tm_sec;
-
- return os.str();
-}
-
-/**
- * Gets the current date.
- *
- * @return the current date as string.
- */
-static std::string getCurrentDate()
-{
- time_t now;
- tm local;
-
- // Get current time_t value
- time(&now);
-
- // Convert time_t to tm struct to break the time into individual
- // constituents.
- local = *(localtime(&now));
-
- // Stringify the time, the format is: yyyy-mm-dd
- using namespace std;
- ostringstream os;
- os << setw(4) << setfill('0') << (local.tm_year + 1900)
- << "-" << setw(2) << setfill('0') << local.tm_mon
- << "-" << setw(2) << setfill('0') << local.tm_mday;
-
- return os.str();
-}
-
-/**
* Check whether the day has changed since the last call.
*
* @return whether the day has changed.