File tree Expand file tree Collapse file tree 5 files changed +15
-5
lines changed Expand file tree Collapse file tree 5 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 11# Automaticly generated by wsjcpp@v0.0.1
22cmake_minimum_required (VERSION 3.0)
33
4- add_definitions (-DWSJCPP_VERSION="v0.1.3 " )
4+ add_definitions (-DWSJCPP_VERSION="v0.1.4 " )
55add_definitions (-DWSJCPP_NAME="wsjcpp-core" )
66
77if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
Original file line number Diff line number Diff line change @@ -644,12 +644,13 @@ std::string WsjcppLog::g_WSJCPP_LOG_DIR = "./";
644644std::string WsjcppLog::g_WSJCPP_LOG_FILE = " " ;
645645std::string WsjcppLog::g_WSJCPP_LOG_PREFIX_FILE = " " ;
646646long WsjcppLog::g_WSJCPP_LOG_START_TIME = 0 ;
647+ long WsjcppLog::g_WSJCPP_LOG_ROTATION_PERIOD_IN_SECONDS = 51000 ;
647648
648649// ---------------------------------------------------------------------
649650
650651void WsjcppLog::doLogRotateUpdateFilename (bool bForce) {
651652 long t = WsjcppCore::currentTime_seconds ();
652- long nEverySeconds = 51000 ; // rotate log if started now or if time left more then 1 day
653+ long nEverySeconds = WsjcppLog::g_WSJCPP_LOG_ROTATION_PERIOD_IN_SECONDS ; // rotate log if started now or if time left more then 1 day
653654 if (g_WSJCPP_LOG_START_TIME == 0 || t - g_WSJCPP_LOG_START_TIME > nEverySeconds || bForce) {
654655 g_WSJCPP_LOG_START_TIME = t;
655656 g_WSJCPP_LOG_FILE = g_WSJCPP_LOG_DIR + " /"
@@ -722,6 +723,13 @@ void WsjcppLog::setPrefixLogFile(const std::string &sPrefixLogFile) {
722723
723724// ---------------------------------------------------------------------
724725
726+ void WsjcppLog::setRotationPeriodInSec (long nRotationPeriodInSec) {
727+ WsjcppLog::g_WSJCPP_LOG_ROTATION_PERIOD_IN_SECONDS = nRotationPeriodInSec;
728+
729+ }
730+
731+ // ---------------------------------------------------------------------
732+
725733void WsjcppLog::initGlobalVariables () {
726734 // create deque if not created
727735 if (WsjcppLog::g_WSJCPP_LOG_LAST_MESSAGES == nullptr ) {
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ class WsjcppLog {
101101 static std::string g_WSJCPP_LOG_PREFIX_FILE;
102102 static std::string g_WSJCPP_LOG_FILE;
103103 static long g_WSJCPP_LOG_START_TIME;
104+ static long g_WSJCPP_LOG_ROTATION_PERIOD_IN_SECONDS;
104105 static std::mutex * g_WSJCPP_LOG_MUTEX;
105106 static std::deque<std::string> * g_WSJCPP_LOG_LAST_MESSAGES;
106107 static void doLogRotateUpdateFilename (bool bForce = false );
@@ -113,6 +114,7 @@ class WsjcppLog {
113114 static std::vector<std::string> getLastLogMessages ();
114115 static void setLogDirectory (const std::string &sDirectoryPath );
115116 static void setPrefixLogFile (const std::string &sPrefixLogFile );
117+ static void setRotationPeriodInSec (long nRotationPeriodInSec);
116118 static void initGlobalVariables ();
117119
118120 private:
Original file line number Diff line number Diff line change 22cmake_minimum_required (VERSION 3.0)
33
44project (unit-tests C CXX)
5- add_definitions (-DWSJCPP_VERSION="ut-v0.1.3 " )
5+ add_definitions (-DWSJCPP_VERSION="ut-v0.1.4 " )
66add_definitions (-DWSJCPP_NAME="unit-tests-wsjcpp-core" )
77
88if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
@@ -19,7 +19,7 @@ set (WSJCPP_SOURCES "")
1919find_package (Threads REQUIRED)
2020list (APPEND WSJCPP_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} )
2121
22- # wsjcpp-core:v0.1.3
22+ # wsjcpp-core:v0.1.4
2323list (APPEND WSJCPP_INCLUDE_DIRS "../src" )
2424list (APPEND WSJCPP_SOURCES "../src/wsjcpp_core.cpp" )
2525list (APPEND WSJCPP_SOURCES "../src/wsjcpp_core.h" )
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ cmake_cxx_standard: 11
33cmake_minimum_required : 3.0
44
55name : wsjcpp-core
6- version : v0.1.3
6+ version : v0.1.4
77description : Basic Utils for wsjcpp
88issues : https://github.com/wsjcpp/wsjcpp-core/issues
99repositories :
You can’t perform that action at this time.
0 commit comments