mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-10-31 16:02:43 +01:00 
			
		
		
		
	Merge pull request #332 from Organic-Code/enhancement/spdlog
Adding spdlog
This commit is contained in:
		| @@ -1,7 +1,7 @@ | ||||
| #include "modules/network.hpp" | ||||
| #include <spdlog/spdlog.h> | ||||
| #include <sys/eventfd.h> | ||||
| #include <fstream> | ||||
| #include <iostream> | ||||
|  | ||||
| namespace { | ||||
|  | ||||
| @@ -13,7 +13,7 @@ namespace { | ||||
|   std::ifstream netstat(NETSTAT_FILE); | ||||
|   std::optional<unsigned long long> read_netstat(std::string_view category, std::string_view key) { | ||||
|     if (!netstat) { | ||||
|       std::cerr << "Failed to open netstat file " << NETSTAT_FILE << '\n' << std::flush; | ||||
|       spdlog::warn("Failed to open netstat file {}", NETSTAT_FILE); | ||||
|       return {}; | ||||
|     } | ||||
|     netstat.seekg(std::ios_base::beg); | ||||
| @@ -28,7 +28,7 @@ namespace { | ||||
|     std::string read; | ||||
|     while (std::getline(netstat, read) && !starts_with(read, category)); | ||||
|     if (!starts_with(read, category)) { | ||||
|       std::cerr << "Category '" << category << "' not found in netstat file " << NETSTAT_FILE << '\n' << std::flush; | ||||
|       spdlog::warn("Category '{}' not found in netstat file {}", category, NETSTAT_FILE); | ||||
|       return {}; | ||||
|     } | ||||
|  | ||||
| @@ -52,7 +52,7 @@ namespace { | ||||
|     } | ||||
|  | ||||
|     if (r_it == read.end() && k_it != key.end()) { | ||||
|       std::cerr << "Key '" << key << "' not found in category '" << category << "' of netstat file " << NETSTAT_FILE << '\n' << std::flush; | ||||
|       spdlog::warn("Key '{}' not found in category '{}' of netstat file {}", key, category, NETSTAT_FILE); | ||||
|       return {}; | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Alex
					Alex