mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Log time with message.
This commit is contained in:
		
							
								
								
									
										4
									
								
								log.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								log.c
									
									
									
									
									
								
							@@ -67,11 +67,13 @@ void
 | 
				
			|||||||
log_vwrite(const char *msg, va_list ap)
 | 
					log_vwrite(const char *msg, va_list ap)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	char	*fmt;
 | 
						char	*fmt;
 | 
				
			||||||
 | 
						time_t	 t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (log_file == NULL)
 | 
						if (log_file == NULL)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (asprintf(&fmt, "%s\n", msg) == -1)
 | 
						t = time(NULL);
 | 
				
			||||||
 | 
						if (asprintf(&fmt, "%lld %s\n", (long long)t, msg) == -1)
 | 
				
			||||||
		exit(1);
 | 
							exit(1);
 | 
				
			||||||
	if (vfprintf(log_file, fmt, ap) == -1)
 | 
						if (vfprintf(log_file, fmt, ap) == -1)
 | 
				
			||||||
		exit(1);
 | 
							exit(1);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user