# Golang Pretty Logger (Warning! Not Maintened.)
### Custom go logger for pretty print, log, debug, warn, error with colours and levels.
![Usage](assets/screencast.gif)
### Install
```bash
go get github.com/happierall/l
```
### Usage
```go
import "github.com/happierall/l"
func main() {
l.Log(10 + 5)
l.Print("Without datetime and code line")
people := &People{"Name"}
l.Debug(people)
l.Warn("Function is depreceted")
l.Error("User is not defined")
l.Logf("%d ms", 10)
l.Printf("Request %s ms", l.Colorize("53", l.Green))
}
type People struct {
Name string
}
```
Terminal output:
![Output struct and int](assets/output.png)
### Custom logger
```go
var log = l.New()
log.Prefix = log.Colorize("[APP] ", l.Blue)
log.Level = l.LevelDebug // default
log.DisabledInfo = true // without date and code line
log.Debug("Message without date and line with prefix")
```
### Production mode
(without colors)
```go
l.Default.Production = true
```
### Subscribe on logs
```go
l.Default.Subscribe(func(text string, lvl l.Level) {
fmt.Println("New log", text, lvl.String())
})
```
### Based on
[y0ssar1an/q](https://github.com/y0ssar1an/q)
### License
[MIT](http://opensource.org/licenses/MIT)
没有合适的资源?快使用搜索试试~ 我知道了~
Go-Golang漂亮打印日志(Logger)
共7个文件
go:3个
license:1个
md:1个
需积分: 50 16 下载量 112 浏览量
2019-08-14
03:30:25
上传
评论
收藏 25.26MB ZIP 举报
温馨提示
自定义Golang日志记录器通过颜色和级别漂亮的打印,日志,调试,警告,错误
资源推荐
资源详情
资源评论
收起资源包目录
Go-Golang漂亮打印日志(Logger).zip (7个子文件)
l-master
helpers.go 7KB
assets
output.png 133KB
screencast.gif 25.85MB
LICENSE 1KB
events.go 272B
README.md 1KB
l.go 6KB
共 7 条
- 1
资源评论
weixin_39840387
- 粉丝: 783
- 资源: 3万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功