Beispiel #1
0
func main2() {
	log := logging.GetDefaultLogger("ckeyer test")

	log.Debug("heelosdf")
	log.Error("heleo")
	log.Info("helelo")
	log.Warning("hhhhh")
}
Beispiel #2
0
	// "github.com/ckeyer/LogC/routers"
	logpkg "github.com/ckeyer/go-log"
	"io"
	"net/http"
	"os"
)

type Logger interface {
	io.Writer
	io.Reader
}

var (
	logfile = "test.log"
	pool    Logger
	log     = logpkg.GetDefaultLogger()
)

type Content struct {
	w   http.ResponseWriter
	req *http.Request
}

func getFilePooler(name string) Logger {
	f, err := os.OpenFile(name, os.O_APPEND, 0600)
	if err != nil {
		log.Error(err.Error())
		return nil
	}
	return f
}
Beispiel #3
0
func init() {
	if log == nil {
		log = logpkg.GetDefaultLogger("blog")
	}
}
Beispiel #4
0
func init() {
	log = logpkg.GetDefaultLogger()
}