func Printf(flags int, format string, v ...interface{}) string {
	str := fmt.Sprintf(format, v...)
	logs := selectLogs(flags)
	for _, l := range logs {
		if l == os.Stdout {
			io.WriteString(l, str+"\n")
		} else {
			io.WriteString(l, getPrefix()+str+"\n")
		}
	}
	if flags&LFatal > 0 {
		os.Exit(1)
	}
	return str
}
Printf is comparable to log.Logger.Printf but takes binary OR'd flags
package gclog
import (
	"errors"
	"fmt"
	"io"
	"os"
	"runtime"
	"time"
)
const (
	logTimeFmt   = "2006/01/02 15:04:05 "
	logFileFlags = os.O_APPEND | os.O_CREATE | os.O_RDWR
	LAccessLog = 1 << iota
	LErrorLog
	LStaffLog
	LStdLog
	LFatal
)
var (
	accessFile *os.File
	errorFile  *os.File
	staffFile  *os.File
	debugLog   bool
)
func selectLogs(flags int) []*os.File {
	var logs []*os.File
	if flags&LAccessLog > 0 {
		logs = append(logs, accessFile)
	}
	if flags&LErrorLog > 0 {
		logs = append(logs, errorFile)
	}
	if flags&LStaffLog > 0 {
		logs = append(logs, staffFile)
	}
	if (flags&LStdLog > 0) || debugLog {
		logs = append(logs, os.Stdout)
	}
	return logs
}
func getPrefix() string {
	prefix := time.Now().Format(logTimeFmt)
	_, file, line, _ := runtime.Caller(2)
	prefix += fmt.Sprint(file, ":", line, ": ")
	return prefix
}
func Print(flags int, v ...interface{}) string {
	str := fmt.Sprint(v...)
	logs := selectLogs(flags)
	for _, l := range logs {
		if l == os.Stdout {
			io.WriteString(l, str+"\n")
		} else {
			io.WriteString(l, getPrefix()+str+"\n")
		}
	}
	if flags&LFatal > 0 {
		os.Exit(1)
	}
	return str
}