summaryrefslogtreecommitdiffstats
path: root/src/common/logging/backend.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-11-02 Refactor Logging ImplLevi Behunin1-0/+2
Loop on stop_token and remove final_entry in Entry. Move Backend thread out of Impl Constructor to its own function. Add Start function for backend thread. Use stop token in PopWait and check if entry filename is nullptr before logging.
2021-08-13logging: Simplify and make thread-safeyzct123451-106/+7
This simplifies the logging system. This also fixes some lost messages on startup. The simplification is simple. I removed unused functions and moved most things in the .h to the .cpp. I replaced the unnecessary linked list with its contents laid out as three member variables. Anything that went through the linked list now directly accesses the backends. Generic functions are replaced with those for each specific use case and there aren't many. This change increases coupling but we gain back more KISS and encapsulation. With those changes it was easy to make it thread-safe. I just removed the mutex and turned a boolean atomic. I was planning to use this thread-safety in my next PR about stacktraces. It was actually async-signal-safety at first but I ended up using a different approach. Anyway getting rid of the linked list is important for that because have the list of backends constantly changing complicates things.
2021-06-13common: logging: Restructure backend codeMorph1-27/+1
2021-06-13common: logging: backend: Wrap IOFile in a unique_ptrMorph1-2/+13
Allows us to forward declare Common::FS::IOFile.
2021-05-26common: fs: Rework the Common Filesystem interface to make use of std::filesystem (#6270)Morph1-2/+3
* common: fs: fs_types: Create filesystem types Contains various filesystem types used by the Common::FS library * common: fs: fs_util: Add std::string to std::u8string conversion utility * common: fs: path_util: Add utlity functions for paths Contains various utility functions for getting or manipulating filesystem paths used by the Common::FS library * common: fs: file: Rewrite the IOFile implementation * common: fs: Reimplement Common::FS library using std::filesystem * common: fs: fs_paths: Add fs_paths to replace common_paths * common: fs: path_util: Add the rest of the path functions * common: Remove the previous Common::FS implementation * general: Remove unused fs includes * string_util: Remove unused function and include * nvidia_flags: Migrate to the new Common::FS library * settings: Migrate to the new Common::FS library * logging: backend: Migrate to the new Common::FS library * core: Migrate to the new Common::FS library * perf_stats: Migrate to the new Common::FS library * reporter: Migrate to the new Common::FS library * telemetry_session: Migrate to the new Common::FS library * key_manager: Migrate to the new Common::FS library * bis_factory: Migrate to the new Common::FS library * registered_cache: Migrate to the new Common::FS library * xts_archive: Migrate to the new Common::FS library * service: acc: Migrate to the new Common::FS library * applets/profile: Migrate to the new Common::FS library * applets/web: Migrate to the new Common::FS library * service: filesystem: Migrate to the new Common::FS library * loader: Migrate to the new Common::FS library * gl_shader_disk_cache: Migrate to the new Common::FS library * nsight_aftermath_tracker: Migrate to the new Common::FS library * vulkan_library: Migrate to the new Common::FS library * configure_debug: Migrate to the new Common::FS library * game_list_worker: Migrate to the new Common::FS library * config: Migrate to the new Common::FS library * configure_filesystem: Migrate to the new Common::FS library * configure_per_game_addons: Migrate to the new Common::FS library * configure_profile_manager: Migrate to the new Common::FS library * configure_ui: Migrate to the new Common::FS library * input_profiles: Migrate to the new Common::FS library * yuzu_cmd: config: Migrate to the new Common::FS library * yuzu_cmd: Migrate to the new Common::FS library * vfs_real: Migrate to the new Common::FS library * vfs: Migrate to the new Common::FS library * vfs_libzip: Migrate to the new Common::FS library * service: bcat: Migrate to the new Common::FS library * yuzu: main: Migrate to the new Common::FS library * vfs_real: Delete the contents of an existing file in CreateFile Current usages of CreateFile expect to delete the contents of an existing file, retain this behavior for now. * input_profiles: Don't iterate the input profile dir if it does not exist Silences an error produced in the log if the directory does not exist. * game_list_worker: Skip parsing file if the returned VfsFile is nullptr Prevents crashes in GetLoader when the virtual file is nullptr * common: fs: Validate paths for path length * service: filesystem: Open the mod load directory as read only
2021-04-20log/backend: Use in-class initializer for FileBackendLioncash1-2/+2
We can also avoid redundant constructions of the same string repeatedly.
2021-04-15common/log: Move Log namespace into the Common namespaceLioncash1-2/+2
Forgot to move this over when I moved the rest of the source files with lacking namespaces over.
2020-08-16common/fileutil: Convert namespace to Common::FSLioncash1-1/+1
Migrates a remaining common file over to the Common namespace, making it consistent with the rest of common files. This also allows for high-traffic FS related code to alias the filesystem function namespace as namespace FS = Common::FS; for more concise typing.
2020-08-03logging/backend: Make use of designated initializersLioncash1-10/+4
Same behavior, less code.
2020-01-23common/logging: don't use regex for path trimmingBreadFish641-1/+1
2019-03-02logging/backend: Move CreateEntry into the Impl classLioncash1-4/+0
This function is only ever used within this source file and makes it easier to remove static state in the following change.
2019-02-15threadsafe_queue: Add WaitIfEmpty and use it in loggingB3n301-0/+1
2018-10-07logging: Add DebuggerBackend for logging to Visual StudioCarl Kenner1-0/+14
2018-09-15Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi1-1/+1
2018-07-20logging/backend: Add missing standard includesLioncash1-2/+0
A few inclusions were being satisfied indirectly. To prevent breakages in the future, include these directly.
2018-07-20logging/backend: Use std::string_view in RemoveBackend() and GetBackend()Lioncash1-2/+3
These can just use a view to a string since its only comparing against two names in both cases for matches. This avoids constructing std::string instances where they aren't necessary.
2018-07-03Add configurable logging backendsJames Rowe1-3/+84
2018-03-22Logging: Create logging macros based on fmtlibDaniel Lim Wee Soong1-2/+5
Add a new set of logging macros based on fmtlib Similar but not exactly the same as https://github.com/citra-emu/citra/pull/3533 Citra currently uses a different version of fmt, which does not support FMT_VARIADIC so make_args is used instead. On the other hand, yuzu uses fmt 4.1.0 which doesn't have make_args yet so FMT_VARIADIC is used.
2018-01-21Format: Run the new clang format on everythingJames Rowe1-1/+1
2016-09-21Remove empty newlines in #include blocks.Emmanuel Gil Peyrot1-1/+0
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
2016-09-18Sources: Run clang-format on everything.Emmanuel Gil Peyrot1-4/+2
2016-02-05backend: defaulted move constructor/assignmentLioncash1-18/+2
2015-05-12Common: Remove async loggingYuri Kunde Schlesner1-80/+12
It provided a large increase in complexity of the logging system while having a negligible performance impact: the usage patterns of the ring buffer meant that each log contended with the logging thread, causing it to effectively act as a synchronous extra buffering. Also removed some broken code related to filtering of subclasses which was broken since it was introduced. (Which means no one ever used that feature anyway, since, 8 months later, no one ever complained.)
2015-03-06Logging: check for filter before sending to the queue, to skip all heavy formatting on the other thread.Emmanuel Gil Peyrot1-0/+3
2014-12-21License changepurpasmart961-1/+1
2014-12-13New logging systemYuri Kunde Schlesner1-0/+134