Vendor sirupsen/logrus@1.3.0
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
		
							
								
								
									
										20
									
								
								vendor/github.com/sirupsen/logrus/terminal_check_windows.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								vendor/github.com/sirupsen/logrus/terminal_check_windows.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| // +build !appengine,!js,windows | ||||
|  | ||||
| package logrus | ||||
|  | ||||
| import ( | ||||
| 	"io" | ||||
| 	"os" | ||||
| 	"syscall" | ||||
| ) | ||||
|  | ||||
| func checkIfTerminal(w io.Writer) bool { | ||||
| 	switch v := w.(type) { | ||||
| 	case *os.File: | ||||
| 		var mode uint32 | ||||
| 		err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode) | ||||
| 		return err == nil | ||||
| 	default: | ||||
| 		return false | ||||
| 	} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 John Howard
					John Howard