mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-11-03 20:42:26 -06:00 
			
		
		
		
	
		
			
	
	
		
			14 lines
		
	
	
	
		
			254 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			14 lines
		
	
	
	
		
			254 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 
								 | 
							
								package logger
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								// Hook defines a log Entry modifier
							 | 
						||
| 
								 | 
							
								type Hook interface {
							 | 
						||
| 
								 | 
							
									Do(*Entry)
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								// HookFunc is a simple adapter to allow functions to satisfy the Hook interface
							 | 
						||
| 
								 | 
							
								type HookFunc func(*Entry)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								func (hook HookFunc) Do(entry *Entry) {
							 | 
						||
| 
								 | 
							
									hook(entry)
							 | 
						||
| 
								 | 
							
								}
							 |