Esempio n. 1
0
File: log.go Progetto: Pereiro/bb
func InitLogger(logFile string, logFormat string, accessLogFile string, accessLogFormat string) {

	loglevel := l4g.INFO
	if conf.DebugMode {
		loglevel = l4g.DEBUG
	}

	log = make(l4g.Logger)
	flw := l4g.NewFileLogWriter(logFile, false)
	flw.SetFormat(logFormat)
	flw.SetRotate(false)
	flw.SetRotateSize(0)
	flw.SetRotateLines(0)
	flw.SetRotateDaily(false)
	log.AddFilter("file", loglevel, flw)

	accessLog = make(l4g.Logger)
	aflw := l4g.NewFileLogWriter(accessLogFile, false)
	aflw.SetFormat(accessLogFormat)
	aflw.SetRotate(false)
	aflw.SetRotateSize(0)
	aflw.SetRotateLines(0)
	aflw.SetRotateDaily(false)
	accessLog.AddFilter("file", loglevel, aflw)

}
Esempio n. 2
0
/*
Init - initialize log lib

RETURNS:
    *Logger, nil - if succeed
    nil, error   - if fail
*/
func (l *Logger) Init() (*Logger, error) {
	// check, and create dir if nonexist
	if err := logDirCreate(l.logDir); err != nil {
		return nil, err
	}

	// default level: INFO
	level := log4go.INFO
	if l.enableDebug {
		level = log4go.DEBUG
	}

	// set logger format
	logFormat := func(enableDebug bool) string {
		if enableDebug {
			return log4go.FORMAT_DEFAULT
		}
		return FORMAT_WITHOUT_SRC
	}(l.enableDebug)

	// create logger
	logger := make(log4go.Logger)

	// create writer for stdout
	if l.enableStdout {
		logger.AddFilter("stdout", level, log4go.NewConsoleLogWriter())
	}

	// create file writer for all log
	fileName := filenameGen(l.progName, l.logDir, false)
	logWriter := log4go.NewFileLogWriter(fileName, l.enableRotate)
	if l.enableRotate {
		logWriter.SetRotateSize(l.rotateSize)
		logWriter.SetRotateDaily(true)
	}
	logWriter.SetFormat(logFormat)
	logger.AddFilter("log", level, logWriter)

	if l.enableWf {
		fileNameWf := filenameGen(l.progName, l.logDir, true)
		logWriterWf := log4go.NewFileLogWriter(fileNameWf, l.enableRotate)
		if l.enableRotate {
			logWriterWf.SetRotateSize(l.rotateSize)
			logWriterWf.SetRotateDaily(true)
		}
		logWriterWf.SetFormat(logFormat)
		logger.AddFilter("log_wf", log4go.WARNING, logWriterWf)
	}

	// set Logger
	l.Logger = logger

	return l, nil
}
Esempio n. 3
0
File: log.go Progetto: wxjs33/kfkcp
func GetLogger(path string, level string) *Log {
	var log Log

	if path == "" {
		path = DEFAULT_LOG_PATH
	}

	lv := log4go.ERROR
	switch level {
	case "debug":
		lv = log4go.DEBUG
	case "error":
		lv = log4go.ERROR
	case "info":
		lv = log4go.INFO
	}

	l := log4go.NewDefaultLogger(lv)
	//l.AddFilter("log", lv, log4go.NewFileLogWriter(path, true))
	l.AddFilter("log", lv, log4go.NewFileLogWriter(path, false))

	log.l = l

	return &log
}
Esempio n. 4
0
func setupLogging(loggingLevel, logFile string) {
	level := log.DEBUG
	switch loggingLevel {
	case "info":
		level = log.INFO
	case "warn":
		level = log.WARNING
	case "error":
		level = log.ERROR
	}

	for _, filter := range log.Global {
		filter.Level = level
	}

	if logFile == "stdout" {
		log.AddFilter("stdout", level, log.NewConsoleLogWriter())
	} else {
		logDir := filepath.Dir(logFile)
		if err := os.MkdirAll(logDir, 0744); err != nil {
			panic(err)
		}

		writer := log.NewFileLogWriter(logFile, false)
		log.AddFilter("file", level, writer)
		writer.SetFormat("[%D %t] [%L] (%S) %M")
		writer.SetRotate(true)
		writer.SetRotateSize(0)
		writer.SetRotateLines(0)
		writer.SetRotateDaily(true)
	}
}
Esempio n. 5
0
File: main.go Progetto: ochz/lime
func main() {
	flag.Parse()

	log4go.AddFilter("file", log4go.FINEST, log4go.NewFileLogWriter("debug.log", *rotateLog))
	defer func() {
		py.NewLock()
		py.Finalize()
	}()

	if err := termbox.Init(); err != nil {
		log4go.Exit(err)
	}
	defer func() {
		termbox.Close()
		log4go.Debug(util.Prof)
		if err := recover(); err != nil {
			log4go.Crash(err)
		}
	}()

	var t tbfe
	t.dorender = make(chan bool, render_chan_len)
	t.layout = make(map[*backend.View]layout)
	t.loop()
}
Esempio n. 6
0
func main() {

	// Set the static directory for webgo
	path := os.Getenv("GOPATH")
	if path == "" {
		fmt.Println("GOPATH NOT SET")
		return
	}
	filepath := fmt.Sprintf("%s/../frontend/src/", path)
	web.Config.StaticDir = filepath

	// Setup logging
	log := make(l4g.Logger)
	// Create a default logger that is logging messages of FINE or higher
	l4g.AddFilter("file", l4g.FINE, l4g.NewFileLogWriter("error_log.log", false))
	log.Close()

	// Setup the DB
	db.Init(path)

	// Parse command line arguments
	port := flag.Int("port", 80, "port number to start the server on")
	flag.Parse()
	url := fmt.Sprintf("0.0.0.0:%d", *port)

	// Start the server!
	serve.Routes()
	web.Run(url)
}
Esempio n. 7
0
func setupLogging(loggingLevel, logFile string) {
	level := log.DEBUG
	switch loggingLevel {
	case "info":
		level = log.INFO
	case "warn":
		level = log.WARNING
	case "error":
		level = log.ERROR
	}

	for _, filter := range log.Global {
		filter.Level = level
	}

	logFileDir := filepath.Dir(logFile)
	os.MkdirAll(logFileDir, 0744)

	flw := log.NewFileLogWriter(logFile, false)
	flw.SetFormat("[%D %T] [%L] (%S) %M")
	flw.SetRotate(true)
	flw.SetRotateSize(0)
	flw.SetRotateLines(0)
	flw.SetRotateDaily(true)
	log.AddFilter("file", level, flw)
	log.Info("Redirectoring logging to %s", logFile)
}
Esempio n. 8
0
func SetupLogging(loggingLevel, logFile string) {
	level := log.DEBUG
	switch loggingLevel {
	case "info":
		level = log.INFO
	case "warn":
		level = log.WARNING
	case "error":
		level = log.ERROR
	}

	log.Global = make(map[string]*log.Filter)
	Global = log.Global
	if logFile == "stdout" || logFile == "" {
		flw := log.NewConsoleLogWriter()
		log.AddFilter("stdout", level, flw)
	} else if logFile == "stderr" || logFile == "" {
		flw := log.NewConsoleLogWriter()
		log.AddFilter("stderr", level, flw)
	} else {
		logFileDir := filepath.Dir(logFile)
		os.MkdirAll(logFileDir, 0744)

		flw := log.NewFileLogWriter(logFile, false)
		log.AddFilter("file", level, flw)

		flw.SetFormat("[%D %T] [%L] (%S) %M")
		flw.SetRotate(true)
		flw.SetRotateSize(0)
		flw.SetRotateLines(0)
		flw.SetRotateDaily(true)
	}

	Global.Info("Redirectoring logging to %s %s", logFile, level)
}
Esempio n. 9
0
func setLogOutput() {
	_, err := os.OpenFile(tywa.LOG_FILE, os.O_RDWR, 0666)
	if err != nil {
		fmt.Println("Unable to open log file. Reason: ", err)
	} else {
		log.AddFilter("file", log.FINE, log.NewFileLogWriter(tywa.LOG_FILE, false))
	}
}
Esempio n. 10
0
func initLogger() {
	logger = make(log4go.Logger)
	logger.AddFilter("stdout", log4go.INFO, log4go.NewConsoleLogWriter())

	if logFileName := configCommon("log", INFO); logFileName != "" {
		logger.AddFilter("file", log4go.INFO, log4go.NewFileLogWriter(logFileName, false).SetFormat("[%D %T][%L]%M - %S"))
	}
	logger.Info("log module initialized")
}
Esempio n. 11
0
File: agent.go Progetto: gbember/gf
func NewAgent(opts Options) *Agent {
	log := l4g.NewLogger()
	log.AddFilter("file", l4g.DEBUG, l4g.NewFileLogWriter("agent.log", false))
	return &Agent{
		opts:      opts,
		exitChan:  make(chan bool),
		startTime: time.Now(),
		clients:   make(map[*Client]struct{}, opts.MaxOnlineNum),
		Logger:    log,
	}
}
Esempio n. 12
0
func main() {
	// Get a new logger instance
	log := l4g.NewLogger()

	// Create a default logger that is logging messages of FINE or higher
	log.AddFilter("file", l4g.FINE, l4g.NewFileLogWriter(filename, false))
	log.Close()

	/* Can also specify manually via the following: (these are the defaults) */
	flw := l4g.NewFileLogWriter(filename, false)
	flw.SetFormat("[%D %T] [%L] (%S) %M")
	flw.SetRotate(false)
	flw.SetRotateSize(0)
	flw.SetRotateLines(0)
	flw.SetRotateDaily(false)
	log.AddFilter("file", l4g.FINE, flw)

	// Log some experimental messages
	log.Finest("Everything is created now (notice that I will not be printing to the file)")
	log.Info("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02"))
	log.Critical("Time to close out!")

	// Close the log
	log.Close()

	// Print what was logged to the file (yes, I know I'm skipping error checking)
	fd, _ := os.Open(filename)
	in := bufio.NewReader(fd)
	fmt.Print("Messages logged to file were: (line numbers not included)\n")
	for lineno := 1; ; lineno++ {
		line, err := in.ReadString('\n')
		if err == io.EOF {
			break
		}
		fmt.Printf("%3d:\t%s", lineno, line)
	}
	fd.Close()

	// Remove the file so it's not lying around
	os.Remove(filename)
}
Esempio n. 13
0
func InitLogger(filename string, logFormat string) {
	log = make(l4g.Logger)

	flw := l4g.NewFileLogWriter(filename, false)
	flw.SetFormat(logFormat)
	flw.SetRotate(false)
	flw.SetRotateSize(0)
	flw.SetRotateLines(0)
	flw.SetRotateDaily(false)
	log.AddFilter("file", l4g.INFO, flw)

	//log.LoadConfiguration(filename)
}
Esempio n. 14
0
func setupLogging(loggingLevel, logFile string) {
	level := log.DEBUG
	switch loggingLevel {
	case "fine":
		level = log.FINE
	case "debug":
		level = log.DEBUG
	case "info":
		level = log.INFO
	case "warn":
		level = log.WARNING
	case "error":
		level = log.ERROR
	default:
		log.Error("Unknown log level %s. Defaulting to DEBUG", loggingLevel)
	}

	log.Global = make(map[string]*log.Filter)

	facility, ok := GetSysLogFacility(logFile)
	if ok {
		flw, err := NewSysLogWriter(facility)
		if err != nil {
			fmt.Fprintf(os.Stderr, "NewSysLogWriter: %s\n", err.Error())
			return
		}
		log.AddFilter("syslog", level, flw)
	} else if logFile == "stdout" {
		flw := log.NewConsoleLogWriter()
		log.AddFilter("stdout", level, flw)
	} else {
		logFileDir := filepath.Dir(logFile)
		os.MkdirAll(logFileDir, 0744)

		flw := log.NewFileLogWriter(logFile, false)
		if flw == nil {
			os.Exit(1)
		}
		log.AddFilter("file", level, flw)

		flw.SetFormat("[%D %T] [%L] (%S) %M")
		flw.SetRotate(true)
		flw.SetRotateSize(0)
		flw.SetRotateLines(0)
		flw.SetRotateDaily(true)
	}

	log.Info("Redirectoring logging to %s", logFile)
}
Esempio n. 15
0
func LogTo(target string, verbosity string) {
	var writer log.LogWriter = nil

	switch target {
	case "stdout":
		writer = log.NewConsoleLogWriter()
	case "none":
		// no logging
	default:
		writer = log.NewFileLogWriter(target, true)
	}

	if writer != nil {
		setupVerbosity(writer, verbosity)
	}
}
Esempio n. 16
0
func LogTo(target string) {
	var writer log.LogWriter = nil

	switch target {
	case "stdout":
		writer = log.NewConsoleLogWriter()
	case "none":
		// no logging
	default:
		writer = log.NewFileLogWriter(target, true)
	}

	if writer != nil {
		root.AddFilter("log", log.TRACE, writer)
	}
}
Esempio n. 17
0
func main() {
	log4go.AddFilter("file", log4go.FINEST, log4go.NewFileLogWriter("debug.log", true))
	defer func() {
		py.NewLock()
		py.Finalize()
	}()

	if err := termbox.Init(); err != nil {
		log4go.Exit(err)
	}

	var t tbfe
	t.dorender = make(chan bool, render_chan_len)
	t.layout = make(map[*backend.View]layout)
	go t.renderthread()
	t.loop()
}
Esempio n. 18
0
func configureLog(s *model.LogSettings) {

	l4g.Close()

	if s.EnableConsole {
		level := l4g.DEBUG
		if s.ConsoleLevel == "INFO" {
			level = l4g.INFO
		} else if s.ConsoleLevel == "WARN" {
			level = l4g.WARNING
		} else if s.ConsoleLevel == "ERROR" {
			level = l4g.ERROR
		}

		l4g.AddFilter("stdout", level, l4g.NewConsoleLogWriter())
	}

	if s.EnableFile {

		var fileFormat = s.FileFormat

		if fileFormat == "" {
			fileFormat = "[%D %T] [%L] %M"
		}

		level := l4g.DEBUG
		if s.FileLevel == "INFO" {
			level = l4g.INFO
		} else if s.FileLevel == "WARN" {
			level = l4g.WARNING
		} else if s.FileLevel == "ERROR" {
			level = l4g.ERROR
		}

		flw := l4g.NewFileLogWriter(GetLogFileLocation(s.FileLocation), false)
		flw.SetFormat(fileFormat)
		flw.SetRotate(true)
		flw.SetRotateLines(LOG_ROTATE_SIZE)
		l4g.AddFilter("file", level, flw)
	}
}
Esempio n. 19
0
func setup_logger() {
	filename := "/var/log/ranger/ranger.log"

	// Create a default logger that is logging messages of FINE or higher to filename, no rotation
	//    log.AddFilter("file", l4g.FINE, l4g.NewFileLogWriter(filename, false))

	// =OR= Can also specify manually via the following: (these are the defaults, this is equivalent to above)
	flw := l4g.NewFileLogWriter(filename, false)
	if flw == nil {
		fmt.Printf("No permission to write to %s, going to switch to stdout only\n", filename)
	} else {
		flw.SetFormat("[%D %T] [%L] (%S) %M")
		flw.SetRotate(false)
		flw.SetRotateSize(0)
		flw.SetRotateLines(0)
		flw.SetRotateDaily(true)
		l4g.AddFilter("file", l4g.DEBUG, flw)

		l4g.AddFilter("stdout", l4g.ERROR, l4g.NewConsoleLogWriter())
	}
}
func main() {
	screen.FillRect(nil, bgcolor)
	go ui_main()

	///////////////////////////////////////////////////////////////
	///////////////////////////////////////////////////////////////
	///////////////////////////////////////////////////////////////

	flw := l4g.NewFileLogWriter("/tmp/golog.log", false)
	flw.SetFormat("[%D %T] [%L] GOMANAGER : %M ")
	flw.SetRotate(false)
	flw.SetRotateSize(0)
	flw.SetRotateLines(0)
	flw.SetRotateDaily(false)
	l4g.AddFilter("file", l4g.FINE, flw)
	l4g.Info(" --- START GOMANAGER ---")
	writeSDLstr(" --- START GOMANAGER ---")

	c, err := NewConsumer(*uri, *exchange, *exchangeType, *queue, *bindingKey, *consumerTag)
	if err != nil {
		log.Fatalf("%s", err)
	}

	if *lifetime > 0 {
		l4g.Info("running for %s", *lifetime)
		time.Sleep(*lifetime)
	} else {
		l4g.Info("running forever")
		writeSDLstr("running forever")
		select {}
	}

	l4g.Info("shutting down")

	if err := c.Shutdown(); err != nil {
		log.Fatalf("error during shutdown: %s", err)
	}

}
Esempio n. 21
0
func LogTo(target string, level_name string) {
	var writer log.LogWriter = nil

	switch target {
	case "stdout":
		writer = log.NewConsoleLogWriter()
	case "none":
		// no logging
	default:
		writer = log.NewFileLogWriter(target, true)
	}

	if writer != nil {
		var level = log.DEBUG

		switch level_name {
		case "FINEST":
			level = log.FINEST
		case "FINE":
			level = log.FINE
		case "DEBUG":
			level = log.DEBUG
		case "TRACE":
			level = log.TRACE
		case "INFO":
			level = log.INFO
		case "WARNING":
			level = log.WARNING
		case "ERROR":
			level = log.ERROR
		case "CRITICAL":
			level = log.CRITICAL
		default:
			level = log.DEBUG
		}

		root.AddFilter("log", level, writer)
	}
}
Esempio n. 22
0
func configureLog(s LogSettings) {

	l4g.Close()

	if s.ConsoleEnable {
		level := l4g.DEBUG
		if s.ConsoleLevel == "INFO" {
			level = l4g.INFO
		} else if s.ConsoleLevel == "ERROR" {
			level = l4g.ERROR
		}

		l4g.AddFilter("stdout", level, l4g.NewConsoleLogWriter())
	}

	if s.FileEnable {
		if s.FileFormat == "" {
			s.FileFormat = "[%D %T] [%L] %M"
		}

		if s.FileLocation == "" {
			s.FileLocation = FindDir("logs") + "mattermost.log"
		}

		level := l4g.DEBUG
		if s.FileLevel == "INFO" {
			level = l4g.INFO
		} else if s.FileLevel == "ERROR" {
			level = l4g.ERROR
		}

		flw := l4g.NewFileLogWriter(s.FileLocation, false)
		flw.SetFormat(s.FileFormat)
		flw.SetRotate(true)
		flw.SetRotateLines(100000)
		l4g.AddFilter("file", level, flw)
	}
}
Esempio n. 23
0
//init for logger
func InitLogger(logFilename string) log4go.Logger {
	//var filenameOnly string = GetCurFilename()
	//var logFilename string =  filenameOnly + ".log";

	//gLogger = log4go.NewLogger()
	//gLogger = make(log4go.Logger)

	//for console
	//gLogger.AddFilter("stdout", log4go.INFO, log4go.NewConsoleLogWriter())
	gLogger = log4go.NewDefaultLogger(log4go.INFO)

	//for log file
	if _, err := os.Stat(logFilename); err == nil {
		//fmt.Printf("found old log file %s, now remove it\n", logFilename)
		os.Remove(logFilename)
	}
	//gLogger.AddFilter("logfile", log4go.FINEST, log4go.NewFileLogWriter(logFilename, true))
	//gLogger.AddFilter("logfile", log4go.FINEST, log4go.NewFileLogWriter(logFilename, false))
	gLogger.AddFilter("log", log4go.FINEST, log4go.NewFileLogWriter(logFilename, false))
	gLogger.Debug("Current time is : %s", time.Now().Format("15:04:05 MST 2006/01/02"))

	return gLogger
}
Esempio n. 24
0
func NewLogger(config *LogConfig) Logger {

	lvl := log4go.DEBUG

	switch config.Level {
	case "finest":
		lvl = log4go.FINEST
	case "fine":
		lvl = log4go.FINE
	case "trace":
		lvl = log4go.TRACE
	case "info":
		lvl = log4go.INFO
	case "warning":
		lvl = log4go.WARNING
	case "error":
		lvl = log4go.ERROR
	case "critical":
		lvl = log4go.CRITICAL
	}

	log := make(log4go.Logger)

	log.AddFilter("stdout", lvl, log4go.NewConsoleLogWriter())

	if config.File != "" {
		file := log4go.NewFileLogWriter(config.File, config.Rotate)

		if config.Format != "" {
			file.SetFormat(config.Format)
		}

		log.AddFilter("file", lvl, file)
	}

	return &log
}
Esempio n. 25
0
func setupLogging(loggingLevel, logFile string) {
	level := log.DEBUG
	switch loggingLevel {
	case "TRACE":
		level = log.TRACE
	case "DEBUG":
		level = log.DEBUG
	case "INFO":
		level = log.INFO
	case "WARN":
		level = log.WARNING
	case "ERROR":
		level = log.ERROR
	}

	log.Global = make(map[string]*log.Filter)

	if logFile == "stdout" {
		flw := log.NewConsoleLogWriter()
		log.AddFilter("stdout", level, flw)

	} else {
		logFileDir := filepath.Dir(logFile)
		os.MkdirAll(logFileDir, 0744)

		flw := log.NewFileLogWriter(logFile, false)
		log.AddFilter("file", level, flw)

		flw.SetFormat("[%D %T] [%L] (%S) %M")
		flw.SetRotate(true)
		flw.SetRotateSize(0)
		flw.SetRotateLines(0)
		flw.SetRotateDaily(true)
	}

	log.Info("Redirectoring logging to %s", logFile)
}
Esempio n. 26
0
func init() {
	runtime.GOMAXPROCS(runtime.NumCPU())

	logger = make(log4go.Logger)
	flw := log4go.NewFileLogWriter("./log/http.log", true)
	flw.SetFormat("[%D %T] [%L] %M")
	flw.SetRotateSize(1024 * 1024 * 1024)
	logger.AddFilter("file", log4go.INFO, flw)

	var err error

	conf, err = ReadConfig("./nethermes.json")
	if err != nil {
		logger.Info("Could not read nethermes.json")
	}
	logger.Info("Using following configuration: %+v", conf)

	idRegex := fmt.Sprintf("[%s]{%d}", conf.KeyCharset, conf.KeyLength)

	rand.Seed(time.Now().Unix() + 3301)
	r := mux.NewRouter()
	s := r.Methods("GET").Subrouter()
	s.HandleFunc("/", IndexHandler)
	s.HandleFunc("/status/{id:"+idRegex+"}", StatusHandler)
	s.HandleFunc("/download/{id:"+idRegex+"}", DownloadHandler)
	s.Handle("/{_:(.*)}", http.FileServer(http.Dir("./htdocs")))
	s = r.Methods("POST").Subrouter()
	s.HandleFunc("/upload/{id:"+idRegex+"}", UploadHandler)
	http.Handle("/", r)

	indextemplate, err = template.ParseFiles("./index.html")
	if err != nil {
		logger.Critical("Parse template: ", err)
		os.Exit(1)
	}
	go CleanOld()
}
Esempio n. 27
0
// checkpoing deamon go
func StartCheckpointDeamon() {

	cpLog.AddFilter("log", log.FINE, log.NewFileLogWriter(CP_FILE_NAME, false))

	//	t := newDeamonTimer(Conf.CheckPointTimeout)

	go func() {
		for {
			select {
			case cp := <-checkpoint:

				writecp(cp, fmt.Sprintf("exceed threshold %d", Conf.CheckPointThreshold))

				//				t.reset()

			case <-time.After(Conf.CheckPointTimeout):
				seconds := int32(time.Now().Unix())
				writecp(int64(seconds)<<32, fmt.Sprintf("timeout %d millisecond", Conf.CheckPointTimeout/(1000*1000)))

				//				t.reset()
			}
		}
	}()
}
Esempio n. 28
0
func main() {
	log := l4g.NewDefaultLogger(l4g.DEBUG)

	//输出到控制台,级别为DEBUG
	log.AddFilter("stdout", l4g.DEBUG, l4g.NewConsoleLogWriter())

	//logs文件夹需要运行前创建,否则异常
	//输出到文件,级别为DEBUG,文件名为test.log,每次追加该原文件
	log.AddFilter("log", l4g.DEBUG, l4g.NewFileLogWriter("logs/test.log", false))

	//使用加载配置文件,类似与java的log4j.propertites
	//l4g.LoadConfiguration("log4go.xml")

	//l4g.Info("xxx")
	//log.Error("yyy")
	log.Debug("the time is now :%s -- %s", "213", "sad")

	//程序退出太快是来不及写log的
	time.Sleep(1000 * time.Millisecond)
	//log.Write2Exit()

	//注:如果不是一直运行的程序,请加上这句话,否则主线程结束后,也不会输出和log到日志文件
	defer log.Close()
}
Esempio n. 29
0
func NewFileLogWriter(fname string, rotate bool) *fileLogWriter {
	ret := &fileLogWriter{
		writer: log4go.NewFileLogWriter(fname, rotate),
	}
	return ret
}
Esempio n. 30
0
func init() {
	keyLog.AddFilter("log", log.FINE, log.NewFileLogWriter("keys-test", false))
}