mirror of
				https://github.com/boostorg/mqtt5.git
				synced 2025-11-04 09:51:37 +01:00 
			
		
		
		
	
		
			
	
	
		
			22 lines
		
	
	
		
			430 B
		
	
	
	
		
			C++
		
	
	
	
	
	
		
		
			
		
	
	
			22 lines
		
	
	
		
			430 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| 
								 | 
							
								#ifndef ASYNC_MQTT5_TEST_PROTOCOL_LOGGING_HPP
							 | 
						||
| 
								 | 
							
								#define ASYNC_MQTT5_TEST_PROTOCOL_LOGGING_HPP
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include <string>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								namespace async_mqtt5::test {
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								inline bool& logging_enabled() {
							 | 
						||
| 
								 | 
							
									static bool enabled = false;
							 | 
						||
| 
								 | 
							
									return enabled;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								inline void log(const std::string& message) {
							 | 
						||
| 
								 | 
							
									if (logging_enabled())
							 | 
						||
| 
								 | 
							
										fprintf(stderr, "%s\n", message.c_str());
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								} // end namespace async_mqtt5::test
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif // ASYNC_MQTT5_TEST_PROTOCOL_LOGGING_HPP
							 |