Skip to content

Commit

Permalink
Fixes issue with preloading closes #87
Browse files Browse the repository at this point in the history
  • Loading branch information
abumq committed Aug 17, 2013
1 parent d639191 commit bc12570
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ Some of logging options can be set by macros, this is a thoughtful decision, for
| `_ELPP_DISABLE_TRACE_LOGS` | Disables trace logs - (preprocessing) |
| `_ELPP_DISABLE_VMODULES_EXTENSION` | Disables vmodules extension. This means if you have a vmodule -vmodule=main*=4 it will cover everything starting with main, where as if you do not have this defined you will be covered for any file starting with main and ending with one of the following extensions; .h .c .cpp .cc .cxx .-inl-.h .hxx .hpp. Please note following vmodule is not correct -vmodule=main.*=4 with this macro not defined because this will check for main..c, notice double dots. If you want this to be valid, have a look at logging flag above: AllowVerboseIfModuleNotSpecified '?' and '*' wildcards are supported |
| `_ELPP_DISABLE_PERFORMANCE_TRACKING` | Disables performance tracking - regardless of what logger is used - (preprocessing) |
| `_ELPP_FORCE_ENV_VAR_FROM_BASH` | If environment variable could not be found, force using alternative bash command to find value, e.g, `whoami` for username. (DO NOT USE WITH `LD_PRELOAD` FOR LIBRARIES THAT ARE ALREADY USING Easylogging++ OR YOU WILL END UP IN STACK OVERFLOW FOR PROCESSES (`popen`) (see [issue #87](https://github.com/easylogging/easyloggingpp/issues/87) for details)) |
[![top] Goto Top](#table-of-contents)
Expand Down
15 changes: 15 additions & 0 deletions doc/RELEASE-NOTES-v9.03
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

Easylogging++ v9.03 RELEASE NOTES
---------------------------------

============================
= BUG FIXES =
============================

- Issue with preloading library that uses easylogging++ (issue #87)

==========================
= NOTES =
==========================

- See https://github.com/easylogging/easyloggingpp/tree/master/doc for other release notes
6 changes: 5 additions & 1 deletion src/easylogging++.h
Original file line number Diff line number Diff line change
Expand Up @@ -1235,14 +1235,18 @@ class OS : private base::StaticClass {
const char* val = getWindowsEnvironmentVariable(variableName);
#endif // _ELPP_OS_UNIX
if ((val == nullptr) || ((strcmp(val, "") == 0))) {
#if _ELPP_OS_UNIX
#if _ELPP_OS_UNIX && defined(_ELPP_FORCE_ENV_VAR_FROM_BASH)
/// Try harder on unix-based systems
std::string valBash = base::utils::OS::getBashOutput(alternativeBashCommand);
if (valBash.empty()) {
return std::string(defaultVal);
} else {
return valBash;
}
#elif _ELPP_OS_UNIX
_ELPP_UNUSED(alternativeBashCommand);
_ELPP_UNUSED(defaultVal);
return std::string();
#elif _ELPP_OS_WINDOWS
_ELPP_UNUSED(alternativeBashCommand);
return std::string(defaultVal);
Expand Down

0 comments on commit bc12570

Please sign in to comment.