Browse Source

Added global to main prettylog

Luis Figueiredo 7 years ago
parent
commit
b2cf034570
2 changed files with 9 additions and 5 deletions
  1. 2 5
      global/register.go
  2. 7 0
      prettylog.go

+ 2 - 5
global/register.go

@@ -1,12 +1,9 @@
 package global
 
 import (
-	"log"
-
-	prettylog "dev.hexasoftware.com/hxs/prettylog.git"
+	"dev.hexasoftware.com/hxs/prettylog"
 )
 
 func init() {
-	log.SetFlags(0)
-	log.SetOutput(prettylog.New())
+	prettylog.Global()
 }

+ 7 - 0
prettylog.go

@@ -6,6 +6,8 @@ import (
 	"runtime"
 	"strings"
 	"time"
+
+	"dev.hexasoftware.com/hxs/prettylog"
 )
 
 type PrettyLogWritter struct {
@@ -53,3 +55,8 @@ func (this *PrettyLogWritter) Write(b []byte) (int, error) {
 func CreateLogger() *log.Logger {
 	return log.New(New(), "", 0)
 }
+
+func Global() {
+	log.SetFlags(0)
+	log.SetOutput(prettylog.New())
+}