tlog

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2018 License: MIT Imports: 6 Imported by: 0

README

tlog

Prepends lines received on STDIN with a time stamp.

Installation

From source:

$ go get jehiah/go-strftime"
$ go get ogier/pflag"
$ go build tlog.go
$ cp tlog /path/

Usage

Basic usage:

long_running_command | tlog

tlog accepts the following options;

`-i`, `--incremental`
Measure incremental time since last line logged.
`-r`, `--relative`
Measure relative time since program start.

Default is to log time in the current time zone in microseconds in the following format: %Y-%m-%dT%H:%M:%S%L

tlog is intended to be used in shell scripts and on CI servers where timing information is usually omitted. Including this will prepend stdout and stderr from your script with a time stamp:

exec > >(tlog) 2>&1

Credits

Developed by Joep van Delft. Discovered that ts is also part of moreutils. On my machine, this go implementation performs 3 times better than the perl script.

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL