logError

package module
v0.0.0-...-f23038d Latest Latest
Warning

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

Go to latest
Published: Nov 29, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(err interface{}, msg string)

Log ... Logs an error if there is an error with logrus

Types

This section is empty.

Jump to

Keyboard shortcuts

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