Skip to content

Commit

Permalink
v3.17 minor logic improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
abumq committed Jan 10, 2013
1 parent 92870d3 commit be9206f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
2 changes: 2 additions & 0 deletions VERSION_HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ History was not kept before version 2.1.
* 3.14: fix for windows compile failure, thanks to `codyzu`
* 3.15: Added more control over disabling logs
Changed from `_DISABLE_EASYLOGGINGPP` to `_DISABLE_LOGS`
* 3.16: Minor improvement
* 3.17: Minor logic improvement
27 changes: 12 additions & 15 deletions easylogging++.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////
// //
// easylogging++.h - Core of EasyLogging++ //
// EasyLogging++ v3.16 //
// EasyLogging++ v3.17 //
// Cross platform logging made easy for C++ applications //
// Author Majid Khan <[email protected]> //
// http://www.icplusplus.com //
Expand Down Expand Up @@ -314,15 +314,12 @@ static inline void updateDateFormat(void) {
const char* timeFormatLocal = "%H:%M:%S";
if (::easyloggingpp::showDate) {
strcpy(::easyloggingpp::dateFormat, dateFormatLocal);
}
else if ((::easyloggingpp::showDateTime) || (::easyloggingpp::showTime)) {
if (::easyloggingpp::showDateTime) {
strcpy(::easyloggingpp::dateFormat, dateFormatLocal);
strcat(::easyloggingpp::dateFormat, " ");
strcat(::easyloggingpp::dateFormat, timeFormatLocal);
} else if (::easyloggingpp::showTime) {
strcpy(::easyloggingpp::dateFormat, timeFormatLocal);
}
} else if (::easyloggingpp::showTime) {
strcpy(::easyloggingpp::dateFormat, timeFormatLocal);
} else if (::easyloggingpp::showDateTime) {
strcpy(::easyloggingpp::dateFormat, dateFormatLocal);
strcat(::easyloggingpp::dateFormat, " ");
strcat(::easyloggingpp::dateFormat, timeFormatLocal);
}
}

Expand Down Expand Up @@ -383,14 +380,14 @@ static void writeLog(void) {
::easyloggingpp::cleanStream();
}

static void updateFormatValue(const std::string& replaceWhat, const std::string& replaceWith, std::string& str) {
static void updateFormatValue(const std::string& formatSpecifier, const std::string& value, std::string& currentFormat) {
size_t foundAt = -1;
while ((foundAt = str.find(replaceWhat, foundAt + 1)) != std::string::npos){
if (str.substr(foundAt, 1) == "\\") {
str = str.erase(foundAt - 2, 1);
while ((foundAt = currentFormat.find(formatSpecifier, foundAt + 1)) != std::string::npos){
if (currentFormat.substr(foundAt, 1) == "\\") {
currentFormat = currentFormat.erase(foundAt - 2, 1);
foundAt++;
} else {
str = str.replace(foundAt, replaceWhat.size(), replaceWith);
currentFormat = currentFormat.replace(foundAt, formatSpecifier.size(), value);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
include_once "../../format.php";
global $webAddr;
$currentVersion = "v3.16";
$currentVersion = "v3.17";
?>
<script language='javascript'>
document.title='EasyLogging++ - C++ Tools';
Expand Down
Binary file modified samples/bin/many_logs.cpp.bin
Binary file not shown.
Binary file modified samples/bin/time_tracker.cpp.bin
Binary file not shown.
Binary file modified samples/bin/time_waster.cpp.bin
Binary file not shown.

0 comments on commit be9206f

Please sign in to comment.