Skip to content

sankalpjonn/pen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

pen

Simple time based and thread safe logger. internally uses the log package

Inspired by

https://github.com/arriqaaq/qalam

Features

  • Create a simple log file handler, will do log rotation automatically.
  • Completely thread safe and can be used inside multiple go routines

Installing

go get -u github.com/sankalpjonn/pen

Example

The example below logs to a file with (%Y%m%d) format:

package main

import (
    "github.com/sankalpjonn/pen"
)

func main() {
    p := pen.New("LOG-PREFIX", "/tmp/log.%Y%m%d")
    p.Write("foo")
    p.Write("bar")

  // to close the pen
    p.Lid()
}

CONTACT

[email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages