Comments (5)
from log.
Admittedly this may be specific to our situation, but we do know that it's safe to unload the log library because we also know that there are no references to it from libraries that are not going to be unloaded. There may still be loggers in existence, but they're all from code that is also being unloaded.
I do agree with you in principle about having the application completely clean up. But in practice we've found it exceedingly difficult to get developers to use the logging library in a way that guarantees that loggers are not "leaked". For example, a logger might be declared as a non-static data member of a larger object that itself is "leaked".
Our guiding principle for logging has been Do No Harm. Developers should be able to (within reason) sprinkle logging in their code without an unnecessary level of concern that doing so may break their code. Unfortunately the consequences of leaking loggers ends up violating this principle for us. Developers add a logger and then the maintainers of our logging system get a bug report that logging is causing crashes...
I'm going to investigate a bit more to see if we can find some other local solution to this, but it would be nice for Boost.Log to be a bit more tolerant of "abuse" from application code.
from log.
from log.
Fair enough. We'll make local changes as necessary then in order to make Boost.Log robust for us. You still might want to take a look at the thread-local data management in core::implementation, though. The thread_specific_ptr is a non-static member, but then there is also the TLS-based member that is static--the discrepancy is odd. FWIW, we do build Boost.Log with compiler TLS support for the slight performance benefit. There's also a mutex used during initialization of thread-local values that's unnecessary.
from log.
The compiler-based TLS is a cache, which is a performance optimization compared to directly accessing thread_specific_ptr
.
Note that making TLS static won't save you from leaking other resources allocated or held indirectly by the core. This includes memory, open files and Windows kernel objects.
from log.
Related Issues (20)
- log lib failed to build due to ERROR: AddressSanitizer: allocator is out of memory trying to allocate on MSVC in asan mode HOT 1
- logging may substantially exceed total_size HOT 9
- Build for Android fails with "error: unable to find library -lrt" HOT 2
- clang-15 warning: definition of implicit copy assignment operator for 'value_ref<jb::severity_level>' is deprecated because it has a user-declared copy constructor
- Performance issue: Boost.Log does a huge work when filtering records HOT 4
- Redirect log records to specific sink only HOT 4
- Max file rotating under the same target directory HOT 1
- BOOST_LOG_TRIVIAL cannot find overloaded `operator<<()` when it's declared in global scope HOT 2
- using BOOST_LOG_TRIVIAL << with string greater than max_size_decor results in bufferoverlfow detected HOT 3
- An infinite loop occurs when boost writes to the log file HOT 4
- Timezone information with text file backend HOT 2
- Boost.Log rotation may throw boost::filesystem::filesystem_error HOT 10
- How to add timezone info for log entries and log filename HOT 3
- Formatting TimeStamp HOT 1
- Boost 1.82, boost\Log\trivial unresolved external symbol error if included after curl HOT 3
- Log Formatting [Conan 2.x, C++20, Boost 1.83] HOT 2
- 1.82.0 compiled for XP uses AcquireSRWLockExclusive HOT 2
- How to append log to same log file after program restarts? HOT 1
- CMake integration for Xcode universal 2 builds HOT 1
- boost日志在动态库里被使用,再次在主程序中使用会崩溃 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from log.