Captain's Log


Lumberjack is a tag logging library. It allows simple logging configuation which allows for logging of messages with tags. It then provides an interface for reading through a log based on tags.

To get tcat:

go get

To install lumberjack and additional modules, check out and do:

go install ./...

Example Code:

package main

import (

func main() {
    logfile, err := os.OpenFile("output.log", os.O_RDWR|os.O_CREATE, 0755)

    if err != nil {

    logger := lumberjack.NewLogger(logfile)

    logger.Log("The network is down", lumberjack.Tags{"network", "debug"})


user@host$ cat test.log 
first:info:test::my first log
second:debug:test::my second log
network:info::I like network cards
second:debug:test::my third log
network bogus line
test::my first log
network::eth0 is up

user@host$ cat test.log | tcat -tags "network"
I like network cards
eth0 is up

user@host$ tcat -tags network,first test.log 
my first log
I like network cards
eth0 is up

(C) 2019 Jeff Aigner | MIT License



Originally Posted by Jeff Aigner, @ 2019-04-09 8:00am PDT