mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	Use go-syslog to fix builds on Windows
This commit is contained in:
		
							parent
							
								
									93a323c62c
								
							
						
					
					
						commit
						23108e268b
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -7,7 +7,6 @@ import (
 | 
				
			||||||
	"flag"
 | 
						"flag"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"io/ioutil"
 | 
						"io/ioutil"
 | 
				
			||||||
	"log/syslog"
 | 
					 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"os/signal"
 | 
						"os/signal"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
| 
						 | 
					@ -16,6 +15,7 @@ import (
 | 
				
			||||||
	"golang.org/x/text/encoding/unicode"
 | 
						"golang.org/x/text/encoding/unicode"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/gologme/log"
 | 
						"github.com/gologme/log"
 | 
				
			||||||
 | 
						gsyslog "github.com/hashicorp/go-syslog"
 | 
				
			||||||
	"github.com/hjson/hjson-go"
 | 
						"github.com/hjson/hjson-go"
 | 
				
			||||||
	"github.com/kardianos/minwinsvc"
 | 
						"github.com/kardianos/minwinsvc"
 | 
				
			||||||
	"github.com/mitchellh/mapstructure"
 | 
						"github.com/mitchellh/mapstructure"
 | 
				
			||||||
| 
						 | 
					@ -168,8 +168,8 @@ func main() {
 | 
				
			||||||
	case "stdout":
 | 
						case "stdout":
 | 
				
			||||||
		logger = log.New(os.Stdout, "", log.Flags())
 | 
							logger = log.New(os.Stdout, "", log.Flags())
 | 
				
			||||||
	case "syslog":
 | 
						case "syslog":
 | 
				
			||||||
		if syslogwriter, err := syslog.New(syslog.LOG_INFO, yggdrasil.BuildName()); err == nil {
 | 
							if syslogger, err := gsyslog.NewLogger(gsyslog.LOG_NOTICE, "DAEMON", yggdrasil.BuildName()); err == nil {
 | 
				
			||||||
			logger = log.New(syslogwriter, "", log.Flags())
 | 
								logger = log.New(syslogger, "", log.Flags())
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		if logfd, err := os.Create(*logto); err == nil {
 | 
							if logfd, err := os.Create(*logto); err == nil {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue