logerror

package module
v0.0.0-...-20a4a86 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: MIT Imports: 3 Imported by: 0

README

logerror

This package allows you to log an error to the console in one line. This package should not be used in production code, only for writing really fast code during something like a competition.

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").Output()
    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