mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-13 12:29:53 +01:00
Stylize log
This commit is contained in:
4
ring.go
4
ring.go
@@ -33,6 +33,10 @@ func (rb *RingBuf) WriteLine(in string) (int, error) {
|
||||
return rb.Write([]byte(fmt.Sprintf("[%s]: %s\n", time.Now().Format("2006-01-02 15:04:05"), in)))
|
||||
}
|
||||
|
||||
func (rb *RingBuf) WriteError(err error) (int, error) {
|
||||
return rb.Write([]byte(fmt.Sprintf("[%s]: ⚠️ %s\n", time.Now().Format("2006-01-02 15:04:05"), err.Error())))
|
||||
}
|
||||
|
||||
// Write writes all data from input buf to RingBuf, overriding looped data
|
||||
func (rb *RingBuf) Write(buf []byte) (int, error) {
|
||||
rb.Lock()
|
||||
|
||||
Reference in New Issue
Block a user