mirror of
				https://github.com/eclipse/upm.git
				synced 2025-10-31 23:24:20 +03:00 
			
		
		
		
	Nice timestamp format using Howard Hinnant's header only date C++ library
Signed-off-by: Mihai Stefanescu <mihai.t.gh.stefanescu@gmail.com>
This commit is contained in:
		 Mihai Stefanescu
					Mihai Stefanescu
				
			
				
					committed by
					
						 Stefan Andritoiu
						Stefan Andritoiu
					
				
			
			
				
	
			
			
			 Stefan Andritoiu
						Stefan Andritoiu
					
				
			
						parent
						
							422b6926b5
						
					
				
				
					commit
					1018ffea16
				
			
							
								
								
									
										8433
									
								
								include/date.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8433
									
								
								include/date.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -24,12 +24,12 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include <chrono> | ||||
| #include <fstream> | ||||
| #include <mutex> | ||||
| #include <sstream> | ||||
| #include <string> | ||||
| #include <thread> | ||||
| #include "date.h" | ||||
|  | ||||
| /* Helper macro for logger utility class. */ | ||||
| #define UPM_LOG(log_level)                                                                       \ | ||||
| @@ -67,10 +67,10 @@ class UPM_LOGGER | ||||
|     std::ofstream& | ||||
|     log(UpmLogLevel level = LOG_ERROR) | ||||
|     { | ||||
|         using namespace std::chrono; | ||||
|  | ||||
|         using namespace date; | ||||
|          | ||||
|         _logStream << "UPM - " | ||||
|                    << duration_cast<nanoseconds>(system_clock::now().time_since_epoch()).count(); | ||||
|                    << std::chrono::system_clock::now(); | ||||
|         _logStream << " [" << getLogLevelName(level) << "] "; | ||||
|  | ||||
|         return _logStream; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user