Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added golog

  • Loading branch information...
commit 736f32e6a527da716553518adc158e4aafe9a815 1 parent 6cf76f6
@treeder treeder authored
Showing with 33 additions and 0 deletions.
  1. +33 −0 src/golog.go
View
33 src/golog.go
@@ -0,0 +1,33 @@
+package golog
+
+import (
+ "log"
+)
+
+const (
+ Debug = iota
+ Info
+ Warn
+ Error
+)
+
+type Logger struct {
+ Level int
+}
+
+func NewLogger() *Logger {
+ l := new(Logger)
+ l.Level = Info
+ return l
+}
+
+func (l *Logger) Debugln(a ...interface{}) {
+ if l.Level <= Debug {
+ log.Println(a...)
+ }
+}
+func (l *Logger) Infoln(a ...interface{}) {
+ if l.Level <= Info {
+ log.Println(a...)
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.