loglines

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 4 Imported by: 6 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

loglines

Basic timestamped console printing.

What

This is a very simple package with three functions:

  • NowString() returns a string with the current time in a format similar to Apache's common log format. Used by the other two functions.
  • Msg() prints a message to stdout.
  • Err() prints an error message to stderr.

That's it. It just prints stuff neatly.

How

Example usage:

import (
	"fmt"
	ll "github.com/grimdork/loglines"
)

func main() {
	ll.Msg("Hello, console!")
	ll.Err("This is an error message.")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Err

func Err(f string, v ...interface{})

Err prints formatted messages to stderr, starting with a nicely formatted timestamp.

func Msg

func Msg(f string, v ...interface{})

Msg prints formatted messages to stdout, starting with a nicely formatted timestamp.

func NowString

func NowString() string

NowString returns a very detailed time string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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