LogError

command module
v0.0.0-...-65bc131 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2019 License: MIT Imports: 2 Imported by: 0

README

LogError

This package allows you to log an error to the console in one line.

Without this package

package main

import (
    "os/exec"
    "github.com/fatih/color"
    log "github.com/sirupsen/logrus"
)

func main() {
    out, err := exec.Command("git", "--version").Output()
    if err != nil {
        color.Red("Printing some information about the command error")
        log.Error(err)
    }
}

With this package

package main

import (
    "os/exec"
    "github.com/Matt-Gleich/LogError"
)

func main() {
    out, err := exec.Command("git", "--version")
    LogError.Log(err, "Printing some information about the command error")
}

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