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 1
1
# Automaticly generated by [email protected]
2
2
cmake_minimum_required (VERSION 3.0 )
3
3
4
- add_definitions (-DWSJCPP_VERSION= "v0.1.3 " )
4
+ add_definitions (-DWSJCPP_VERSION= "v0.1.4 " )
5
5
add_definitions (-DWSJCPP_NAME= "wsjcpp-core" )
6
6
7
7
if (${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 = "./";
644
644
std::string WsjcppLog::g_WSJCPP_LOG_FILE = " " ;
645
645
std::string WsjcppLog::g_WSJCPP_LOG_PREFIX_FILE = " " ;
646
646
long WsjcppLog::g_WSJCPP_LOG_START_TIME = 0 ;
647
+ long WsjcppLog::g_WSJCPP_LOG_ROTATION_PERIOD_IN_SECONDS = 51000 ;
647
648
648
649
// ---------------------------------------------------------------------
649
650
650
651
void WsjcppLog::doLogRotateUpdateFilename (bool bForce) {
651
652
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
653
654
if (g_WSJCPP_LOG_START_TIME == 0 || t - g_WSJCPP_LOG_START_TIME > nEverySeconds || bForce) {
654
655
g_WSJCPP_LOG_START_TIME = t;
655
656
g_WSJCPP_LOG_FILE = g_WSJCPP_LOG_DIR + " /"
@@ -722,6 +723,13 @@ void WsjcppLog::setPrefixLogFile(const std::string &sPrefixLogFile) {
722
723
723
724
// ---------------------------------------------------------------------
724
725
726
+ void WsjcppLog::setRotationPeriodInSec (long nRotationPeriodInSec) {
727
+ WsjcppLog::g_WSJCPP_LOG_ROTATION_PERIOD_IN_SECONDS = nRotationPeriodInSec;
728
+
729
+ }
730
+
731
+ // ---------------------------------------------------------------------
732
+
725
733
void WsjcppLog::initGlobalVariables () {
726
734
// create deque if not created
727
735
if (WsjcppLog::g_WSJCPP_LOG_LAST_MESSAGES == nullptr ) {
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ class WsjcppLog {
101
101
static std::string g_WSJCPP_LOG_PREFIX_FILE;
102
102
static std::string g_WSJCPP_LOG_FILE;
103
103
static long g_WSJCPP_LOG_START_TIME;
104
+ static long g_WSJCPP_LOG_ROTATION_PERIOD_IN_SECONDS;
104
105
static std::mutex * g_WSJCPP_LOG_MUTEX;
105
106
static std::deque<std::string> * g_WSJCPP_LOG_LAST_MESSAGES;
106
107
static void doLogRotateUpdateFilename (bool bForce = false );
@@ -113,6 +114,7 @@ class WsjcppLog {
113
114
static std::vector<std::string> getLastLogMessages ();
114
115
static void setLogDirectory (const std::string &sDirectoryPath );
115
116
static void setPrefixLogFile (const std::string &sPrefixLogFile );
117
+ static void setRotationPeriodInSec (long nRotationPeriodInSec);
116
118
static void initGlobalVariables ();
117
119
118
120
private:
Original file line number Diff line number Diff line change 2
2
cmake_minimum_required (VERSION 3.0 )
3
3
4
4
project (unit-tests C CXX )
5
- add_definitions (-DWSJCPP_VERSION= "ut-v0.1.3 " )
5
+ add_definitions (-DWSJCPP_VERSION= "ut-v0.1.4 " )
6
6
add_definitions (-DWSJCPP_NAME= "unit-tests-wsjcpp-core" )
7
7
8
8
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
@@ -19,7 +19,7 @@ set (WSJCPP_SOURCES "")
19
19
find_package (Threads REQUIRED )
20
20
list (APPEND WSJCPP_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} )
21
21
22
- # wsjcpp-core:v0.1.3
22
+ # wsjcpp-core:v0.1.4
23
23
list (APPEND WSJCPP_INCLUDE_DIRS "../src" )
24
24
list (APPEND WSJCPP_SOURCES "../src/wsjcpp_core.cpp" )
25
25
list (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
3
3
cmake_minimum_required : 3.0
4
4
5
5
name : wsjcpp-core
6
- version : v0.1.3
6
+ version : v0.1.4
7
7
description : Basic Utils for wsjcpp
8
8
issues : https://github.com/wsjcpp/wsjcpp-core/issues
9
9
repositories :
You can’t perform that action at this time.
0 commit comments