mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	daemon logging: unifying output and timestamps
A little refactor of the ./pkg/log so engine can have a logger instance Signed-off-by: Vincent Batts <vbatts@redhat.com>
This commit is contained in:
		
							parent
							
								
									4547b6d529
								
							
						
					
					
						commit
						92df943fbf
					
				
					 8 changed files with 76 additions and 43 deletions
				
			
		| 
						 | 
				
			
			@ -1,11 +1,12 @@
 | 
			
		|||
package signal
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"log"
 | 
			
		||||
	"os"
 | 
			
		||||
	gosignal "os/signal"
 | 
			
		||||
	"sync/atomic"
 | 
			
		||||
	"syscall"
 | 
			
		||||
 | 
			
		||||
	"github.com/docker/docker/pkg/log"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Trap sets up a simplified signal "trap", appropriate for common
 | 
			
		||||
| 
						 | 
				
			
			@ -28,7 +29,7 @@ func Trap(cleanup func()) {
 | 
			
		|||
		interruptCount := uint32(0)
 | 
			
		||||
		for sig := range c {
 | 
			
		||||
			go func(sig os.Signal) {
 | 
			
		||||
				log.Printf("Received signal '%v', starting shutdown of docker...\n", sig)
 | 
			
		||||
				log.Infof("Received signal '%v', starting shutdown of docker...", sig)
 | 
			
		||||
				switch sig {
 | 
			
		||||
				case os.Interrupt, syscall.SIGTERM:
 | 
			
		||||
					// If the user really wants to interrupt, let him do so.
 | 
			
		||||
| 
						 | 
				
			
			@ -43,7 +44,7 @@ func Trap(cleanup func()) {
 | 
			
		|||
							return
 | 
			
		||||
						}
 | 
			
		||||
					} else {
 | 
			
		||||
						log.Printf("Force shutdown of docker, interrupting cleanup\n")
 | 
			
		||||
						log.Infof("Force shutdown of docker, interrupting cleanup")
 | 
			
		||||
					}
 | 
			
		||||
				case syscall.SIGQUIT:
 | 
			
		||||
				}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue