Commit 9cf1b93f authored by Scott Cantor's avatar Scott Cantor
Browse files
parent ad4aff91
This file describes the changes to the Log for C++ library. See the repository for more detailed descriptions.
2009-11-18 Scott Cantor <cantor.2@osu.edu>
* port over upstream fixes for vararg bug on x86_64 and other small bugs
2009-08-04 Scott Cantor <cantor.2@osu.edu>
* fix error handling when Appenders fail
* correct crash when file appender can't open file
......
AC_INIT(log4shib, 1.0.3)
AC_INIT(log4shib, 1.0.4)
# autoconf 2.50 or higher to rebuild aclocal.m4, because the
# AC_CREATE_PREFIX_CONFIG_H macro needs the AS_DIRNAME macro.
......@@ -11,7 +11,7 @@ AC_PREREQ(2.50)
# ? :+1 : ? == just some internal changes, nothing breaks but might work
# better
# CURRENT : REVISION : AGE
LT_VERSION=1:3:0
LT_VERSION=1:4:0
AC_SUBST(LT_VERSION)
......
......@@ -10,8 +10,8 @@
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,3,0
PRODUCTVERSION 1,0,3,0
FILEVERSION 1,0,4,0
PRODUCTVERSION 1,0,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
......@@ -30,7 +30,7 @@ BEGIN
VALUE "CompanyName", "Internet2\0"
VALUE "ContributingAuthors", "Cedric Le Goater, Marc Welz, others. See documentation for complete list\0"
VALUE "FileDescription", "Log library for C++ DLL\0"
VALUE "FileVersion", "1.0.3\0"
VALUE "FileVersion", "1.0.4\0"
VALUE "InternalName", "log4shib\0"
VALUE "LegalCopyright", "Copyright 2000-2002 the Log4cpp Project, others\0"
VALUE "LegalTrademarks", "\0"
......@@ -41,7 +41,7 @@ BEGIN
#endif
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Log library for C++\0"
VALUE "ProductVersion", "1.0.3\0"
VALUE "ProductVersion", "1.0.4\0"
VALUE "SpecialBuild", "\0"
END
END
......
......@@ -10,8 +10,8 @@
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,3,0
PRODUCTVERSION 1,0,3,0
FILEVERSION 1,0,4,0
PRODUCTVERSION 1,0,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
......@@ -30,7 +30,7 @@ BEGIN
VALUE "CompanyName", "Internet2\0"
VALUE "ContributingAuthors", "Cedric Le Goater, Marc Welz, others. See documentation for complete list\0"
VALUE "FileDescription", "Log library for C++ DLL\0"
VALUE "FileVersion", "1.0.3\0"
VALUE "FileVersion", "1.0.4\0"
VALUE "InternalName", "log4shib\0"
VALUE "LegalCopyright", "Copyright 2000-2002 the Log4cpp Project, others\0"
VALUE "LegalTrademarks", "\0"
......@@ -41,7 +41,7 @@ BEGIN
#endif
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Log library for C++\0"
VALUE "ProductVersion", "1.0.3\0"
VALUE "ProductVersion", "1.0.4\0"
VALUE "SpecialBuild", "\0"
END
END
......
......@@ -10,8 +10,8 @@
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,3,0
PRODUCTVERSION 1,0,3,0
FILEVERSION 1,0,4,0
PRODUCTVERSION 1,0,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
......@@ -30,7 +30,7 @@ BEGIN
VALUE "CompanyName", "Internet2\0"
VALUE "ContributingAuthors", "Cedric Le Goater, Marc Welz, others. See documentation for complete list\0"
VALUE "FileDescription", "Log library for C++ DLL\0"
VALUE "FileVersion", "1.0.3\0"
VALUE "FileVersion", "1.0.4\0"
VALUE "InternalName", "log4shib\0"
VALUE "LegalCopyright", "Copyright 2000-2002 the Log4cpp Project, others\0"
VALUE "LegalTrademarks", "\0"
......@@ -41,7 +41,7 @@ BEGIN
#endif
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Log library for C++\0"
VALUE "ProductVersion", "1.0.3\0"
VALUE "ProductVersion", "1.0.4\0"
VALUE "SpecialBuild", "\0"
END
END
......
......@@ -11,6 +11,7 @@
#include <log4shib/Appender.hh>
namespace log4shib {
Appender::AppenderMap* Appender::_allAppenders = NULL;
threading::Mutex Appender::_appenderMapMutex;
/* assume _appenderMapMutex locked */
......
......@@ -233,7 +233,7 @@ namespace log4shib {
msg.erase(_maxWidth);
}
std::string::size_type fillCount = _minWidth - msg.length();
if (fillCount > 0) {
if (_minWidth > msg.length()) {
if (_alignLeft) {
out << msg << std::string(fillCount, ' ');
} else {
......
......@@ -35,27 +35,36 @@ extern "C" {
namespace log4shib {
std::string StringUtil::vform(const char* format, va_list args) {
size_t size = 1024;
char* buffer = new char[size];
size_t size = 1024;
char* buffer = new char[size];
while (1) {
int n = VSNPRINTF(buffer, size, format, args);
// If that worked, return a string.
if ((n > -1) && (static_cast<size_t>(n) < size)) {
std::string s(buffer);
delete [] buffer;
return s;
}
// Else try again with more space.
size = (n > -1) ?
n + 1 : // ISO/IEC 9899:1999
size * 2; // twice the old size
delete [] buffer;
buffer = new char[size];
}
while (1) {
va_list args_copy;
#if defined(_MSC_VER) || defined(__BORLANDC__)
args_copy = args;
#else
va_copy(args_copy, args);
#endif
int n = VSNPRINTF(buffer, size, format, args_copy);
va_end(args_copy);
// If that worked, return a string.
if ((n > -1) && (static_cast<size_t>(n) < size)) {
std::string s(buffer);
delete [] buffer;
return s;
}
// Else try again with more space.
size = (n > -1) ?
n + 1 : // ISO/IEC 9899:1999
size * 2; // twice the old size
delete [] buffer;
buffer = new char[size];
}
}
std::string StringUtil::trim(const std::string& s) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment