aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/logging.cpp
Commit message (Collapse)AuthorAgeFilesLines
* misc fixes brought over from sb/proto (#759)Stefan Boberg2026-02-171-1/+1
| | | | | | | | * `RwLock::WithSharedLock` and `RwLock::WithExclusiveLock` can now return a value (which is returned by the passed function) * Comma-separated logger specification now correctly deals with commas * `GetSystemMetrics` properly accounts for cores * cpr response formatter passes arguments in the right order * `HttpServerRequest::SetLogRequest` can be used to selectively log HTTP requests
* added ResetConsoleLog (#758)Stefan Boberg2026-02-161-0/+8
| | | also made sure log initialization calls it to ensure the console output format is retained even if the console logger was set up before logging is initialized
* fixed race condition in zen::logging::Get (#519)Stefan Boberg2025-09-291-3/+12
| | | if two requests for the same logger came in from different threads they could end up creating the same logger twice which causes an exception on registration
* improve console output (#476)Dan Engelbrecht2025-08-261-0/+23
| | | | * add color coded logging level to console output (for warn/err/crit levels) * clean up console output
* added support for dynamic LLM tags (#245)Stefan Boberg2024-12-021-13/+13
| | | | | * added FLLMTag which can be used to register memory tags outside of core * changed `UE_MEMSCOPE` -> `ZEN_MEMSCOPE` for consistency * instrumented some subsystems with dynamic tags
* Insights-compatible memory tracking (#214)Stefan Boberg2024-11-251-0/+22
| | | | | | | | | | | | | This change introduces support for tracing of memory allocation activity. The code is ported from UE5, and Unreal Insights can be used to analyze the output. This is currently only fully supported on Windows, but will be extended to Mac/Linux in the near future. To activate full memory tracking, pass `--trace=memory` on the commandline alongside `--tracehost=<ip>` or `-tracefile=<path>`. For more control over how much detail is traced you can instead pass some combination of `callstack`, `memtag`, `memalloc` instead. In practice, `--trace=memory` is an alias for `--trace=callstack,memtag,memalloc`). For convenience we also support `--trace=memory_light` which omits call stacks. This change also introduces multiple memory allocators, which may be selected via command-line option `--malloc=<allocator>`: * `mimalloc` - mimalloc (default, same as before) * `rpmalloc` - rpmalloc is another high performance allocator for multithreaded applications which may be a better option than mimalloc (to be evaluated). Due to toolchain limitations this is currently only supported on Windows. * `stomp` - an allocator intended to be used during development/debugging to help track down memory issues such as use-after-free or out-of-bounds access. Currently only supported on Windows. * `ansi` - fallback to default system allocator
* assert improvements (#72)Dan Engelbrecht2024-05-031-0/+6
| | | | | - Improvement: Asserts gives an immediate ERROR log entry with callstack and reason - Improvement: Asserts flushes the log before sending error report to Sentry
* SuppressConsoleLog now removes any existing console logger (#599)Stefan Boberg2023-12-111-0/+5
| | | SuppressConsoleLog now removes any existing console logger to avoid exceptions in spdlog
* logging configuration via command line options (#589)Stefan Boberg2023-12-061-0/+77
| | | | | | | with these changes it is possible to configure loggers on the command line. For instance: `xmake run zenserver --log-trace=http_requests,http` will configure the system so that the `http_request` and `http` loggers are set to TRACE level
* HTTP plugin request debug logging (#587)Stefan Boberg2023-12-051-0/+12
| | | | | | * added log level control/query to LoggerRef * added debug logging to http plugin implementation * added GetDebugName() to transport plugin interfaces * added debug name to log output
* Don't call spdlog::drop_all, spdlog::shutdown will do that for us in a ↵Dan Engelbrecht2023-11-271-1/+0
| | | | controlled manner (#573)
* spdlog implementation hiding (#498)Stefan Boberg2023-11-061-25/+216
| | | | | | | | | this change aims to hide logging internals from client code, in order to make it easier to extend and take more control over the logging process in the future. As a bonus side effect, the generated code is much tighter (net delta around 2.5% on the resulting executable which includes lots of thirdparty code) and should take less time to compile and link. Client usage via macros is pretty much unchanged. The main exposure client code had to spdlog internals before was the use of custom loggers per subsystem, where it would be common to have `spdlog::logger` references to keep a reference to a logger within a class. This is now replaced by `zen::LoggerRef` which currently simply encapsulates an actual `spdlog::logger` instance, but this is intended to be an implementation detail which will change in the future. The way the change works is that we now handle any formatting of log messages in the zencore logging subsystem instead of relying on `spdlog` to manage this. We use the `fmt` library to do the formatting which means the client usage is identical to using `spdlog`. The formatted message is then forwarded onto any sinks etc which are still implememted via `spdlog`.
* eliminate redundant logging code (#499)Stefan Boberg2023-10-251-0/+4
| | | | | | | | | zenutil and zenserver both contain very similar logging setup code and this change aims to make them have most code in common. * fullformatter/jsonformatter/RotatingFileSink are moved into dedicated header files in zenutil * zenserver `InitializeLogging`/`ShutdownLogging` are renamed `InitializeServerLogging`/`InitializeServerLogging` * these now call into the common zenutil `BeginInitializeLogging`/`FinishInitializeLogging` in addition to setting up server custom logging * `std::filesystem::path` is now logged after stripping any `\\\\?\\` prefix for readability
* added --quiet option to suppress default logging to stdout (#446)Stefan Boberg2023-10-041-2/+12
| | | | added --quiet option for zenserver to suppress default logging to stdout
* block destructors from throwing exceptions (#321)Dan Engelbrecht2023-05-241-1/+5
| | | | | | * ~FileMapping() is not allowed to throw exceptions * ~ScopedActivityBase() should not call ZEN_ASSERT (which causes SIGABORT on error) * ProjectStore::Project::WriteAccessTimes() which is called from ProjectStore::~Project() must not throw exceptions * changelog
* Moved EnableVTMode function into zencore (#311)Stefan Boberg2023-05-161-0/+27
|
* make logging tests run as part of zencore-testStefan Boberg2023-05-091-1/+1
|
* implemented thread-local activity trackingStefan Boberg2023-05-091-0/+111
| | | includes support for on-demand formatting of scope in error messages
* moved source directories into `/src` (#264)Stefan Boberg2023-05-021-0/+85
* moved source directories into `/src` * updated bundle.lua for new `src` path * moved some docs, icon * removed old test trees