|
|
@ -9,7 +9,7 @@ package main
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"github.com/subchen/go-log"
|
|
|
|
"github.com/fangdingjun/go-log"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
func main() {
|
|
|
@ -21,7 +21,7 @@ package main
|
|
|
|
Output:
|
|
|
|
Output:
|
|
|
|
|
|
|
|
|
|
|
|
07:34:23.039 INFO some message
|
|
|
|
07:34:23.039 INFO some message
|
|
|
|
07:34:23.039 INFO $HOME = /home/subchen
|
|
|
|
07:34:23.039 INFO $HOME = /home/fangdingjun
|
|
|
|
07:34:23.039 ERROR Got err: permission denied
|
|
|
|
07:34:23.039 ERROR Got err: permission denied
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -31,9 +31,9 @@ You also can config `log.Default` or new `log.Logger` to customize formatter and
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"github.com/subchen/go-log"
|
|
|
|
"github.com/fangdingjun/go-log"
|
|
|
|
"github.com/subchen/go-log/formatters"
|
|
|
|
"github.com/fangdingjun/go-log/formatters"
|
|
|
|
"github.com/subchen/go-log/writers"
|
|
|
|
"github.com/fangdingjun/go-log/writers"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
func main() {
|
|
|
@ -57,7 +57,7 @@ Output log in `/tmp/test.log`:
|
|
|
|
2018-05-19T07:49:05.979+0000 INFO devbox main 9981 example/main.go:17 some message
|
|
|
|
2018-05-19T07:49:05.979+0000 INFO devbox main 9981 example/main.go:17 some message
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For a full guide visit https://github.com/subchen/go-log
|
|
|
|
For a full guide visit https://github.com/fangdingjun/go-log
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
package log
|
|
|
|
package log
|
|
|
|