https://github.com/vikpe/prettyfmt
Go fmt with colored prefix and timestamp.
https://github.com/vikpe/prettyfmt
go print terminal
Last synced: 2 months ago
JSON representation
Go fmt with colored prefix and timestamp.
- Host: GitHub
- URL: https://github.com/vikpe/prettyfmt
- Owner: vikpe
- Created: 2022-07-06T12:49:15.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-20T17:55:23.000Z (almost 4 years ago)
- Last Synced: 2025-01-11T02:25:37.347Z (over 1 year ago)
- Topics: go, print, terminal
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# prettyfmt [](https://github.com/vikpe/prettyfmt/actions/workflows/test.yml) [](https://codecov.io/gh/vikpe/prettyfmt) [](https://goreportcard.com/report/github.com/vikpe/prettyfmt)
> Go fmt with colored prefix and timestamp
```shell
go get github.com/vikpe/prettyfmt
```
## Synopsis
Colors from [github.com/fatih/color](https://github.com/fatih/color) ([list of values](https://github.com/fatih/color/blob/main/color.go#L69))
```
New(
prefix string,
prefixColor color.Attribute,
timestampFormat string,
timestampColor color.Attribute
)
```
## Usage
```go
pfmt := prettyfmt.New("chatbot", color.FgHiBlue, "15:04:05", color.FgWhite)
pfmt.Println("start")
pfmt.Printfln("connected as %s", "vikpebot")
```
