Update current_size_ to 0 in after of truncating in rotation error
This commit is contained in:
		
							parent
							
								
									f1ab6feba2
								
							
						
					
					
						commit
						b64e4464a7
					
				@ -105,6 +105,7 @@ private:
 | 
				
			|||||||
                if (!rename_file(src, target))
 | 
					                if (!rename_file(src, target))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    file_helper_.reopen(true); // truncate the log file anyway to prevent it to grow beyond its limit!
 | 
					                    file_helper_.reopen(true); // truncate the log file anyway to prevent it to grow beyond its limit!
 | 
				
			||||||
 | 
					                    current_size_ = 0;
 | 
				
			||||||
                    throw spdlog_ex(
 | 
					                    throw spdlog_ex(
 | 
				
			||||||
                        "rotating_file_sink: failed renaming " + filename_to_str(src) + " to " + filename_to_str(target), errno);
 | 
					                        "rotating_file_sink: failed renaming " + filename_to_str(src) + " to " + filename_to_str(target), errno);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user