feat(server): Use hash of Nixery source as version
Uses a hash of Nixery's sources as the version displayed when Nixery launches or logs an error. This makes it possible to distinguish between errors logged from different versions. The source hashes should be reproducible between different checkouts of the same source tree.
This commit is contained in:
		
							parent
							
								
									95abb1bcde
								
							
						
					
					
						commit
						6912658c72
					
				
					 4 changed files with 48 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -27,7 +27,6 @@ type reportLocation struct {
 | 
			
		|||
 | 
			
		||||
var nixeryContext = serviceContext{
 | 
			
		||||
	Service: "nixery",
 | 
			
		||||
	Version: "TODO(tazjin)", // angry?
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// isError determines whether an entry should be logged as an error
 | 
			
		||||
| 
						 | 
				
			
			@ -63,6 +62,7 @@ func (f stackdriverFormatter) Format(e *log.Entry) ([]byte, error) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	nixeryContext.Version = version
 | 
			
		||||
	log.SetReportCaller(true)
 | 
			
		||||
	log.SetFormatter(stackdriverFormatter{})
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue