mirror of
https://github.com/KjellKod/g3log.git
synced 2024-12-13 10:42:56 +01:00
Merge branch 'master' into include-file-path-only
This commit is contained in:
commit
b1088d06ab
@ -25,7 +25,9 @@ before_install:
|
|||||||
sudo apt-get install python-software-properties;
|
sudo apt-get install python-software-properties;
|
||||||
sudo apt-get update;
|
sudo apt-get update;
|
||||||
sudo apt-get install gcc-5 g++-5;
|
sudo apt-get install gcc-5 g++-5;
|
||||||
sudo add-apt-repository --yes ppa:kalakris/cmake;
|
sudo apt-get install software-properties-common;
|
||||||
|
sudo add-apt-repository -y ppa:george-edison55/cmake-3.x;
|
||||||
|
sudo apt-get update;
|
||||||
sudo apt-get update -qq;
|
sudo apt-get update -qq;
|
||||||
sudo apt-get install cmake;
|
sudo apt-get install cmake;
|
||||||
fi
|
fi
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#
|
#
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
cmake_minimum_required (VERSION 2.8)
|
cmake_minimum_required (VERSION 3.1)
|
||||||
ENABLE_LANGUAGE(CXX)
|
ENABLE_LANGUAGE(CXX)
|
||||||
set(CMAKE_BUILD_TYPE Release)
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
|
|
||||||
|
@ -30,6 +30,11 @@ namespace example_fatal
|
|||||||
}
|
}
|
||||||
} // example fatal
|
} // example fatal
|
||||||
|
|
||||||
|
#ifdef CHANGE_G3LOG_DEBUG_TO_DBUG
|
||||||
|
#undef DEBUG
|
||||||
|
#define DEBUG DBUG
|
||||||
|
#endif
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
double pi_d = 3.1415926535897932384626433832795;
|
double pi_d = 3.1415926535897932384626433832795;
|
||||||
|
@ -24,6 +24,11 @@
|
|||||||
#define NOEXCEPT throw()
|
#define NOEXCEPT throw()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CHANGE_G3LOG_DEBUG_TO_DBUG
|
||||||
|
#undef DEBUG
|
||||||
|
#define DEBUG DBUG
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
|
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
|
||||||
|
@ -22,6 +22,11 @@ namespace
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CHANGE_G3LOG_DEBUG_TO_DBUG
|
||||||
|
#undef DEBUG
|
||||||
|
#define DEBUG DBUG
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace example_fatal
|
namespace example_fatal
|
||||||
{
|
{
|
||||||
// on Ubunti this caused get a compiler warning with gcc4.6
|
// on Ubunti this caused get a compiler warning with gcc4.6
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
# include <sal.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple struct for capturing log/fatal entries. At destruction the captured message is
|
* Simple struct for capturing log/fatal entries. At destruction the captured message is
|
||||||
@ -49,8 +52,17 @@ struct LogCapture {
|
|||||||
// Ref: http://www.unixwiz.net/techtips/gnu-c-attributes.html
|
// Ref: http://www.unixwiz.net/techtips/gnu-c-attributes.html
|
||||||
#ifndef __GNUC__
|
#ifndef __GNUC__
|
||||||
#define __attribute__(x) // Disable 'attributes' if compiler does not support 'em
|
#define __attribute__(x) // Disable 'attributes' if compiler does not support 'em
|
||||||
|
#endif
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
# if _MSC_VER >= 1400
|
||||||
|
# define G3LOG_FORMAT_STRING _Printf_format_string_
|
||||||
|
# else
|
||||||
|
# define G3LOG_FORMAT_STRING __format_string
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# define G3LOG_FORMAT_STRING
|
||||||
#endif
|
#endif
|
||||||
void capturef(const char *printf_like_message, ...) __attribute__((format(printf, 2, 3))); // 2,3 ref: http://www.codemaestro.com/reviews/18
|
void capturef(G3LOG_FORMAT_STRING const char *printf_like_message, ...) __attribute__((format(printf, 2, 3))); // 2,3 ref: http://www.codemaestro.com/reviews/18
|
||||||
|
|
||||||
|
|
||||||
/// prettifying API for this completely open struct
|
/// prettifying API for this completely open struct
|
||||||
|
@ -135,6 +135,9 @@ private:
|
|||||||
};
|
};
|
||||||
} // testing_helpers
|
} // testing_helpers
|
||||||
|
|
||||||
|
#ifdef CHANGE_G3LOG_DEBUG_TO_DBUG
|
||||||
|
#undef DEBUG
|
||||||
|
#define DEBUG DBUG
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user