Categorygithub.com/9dl/BetterErrors
repositorypackage
0.0.0-20240227074019-6e4275c90a28
Repository: https://github.com/9dl/bettererrors.git
Documentation: pkg.go.dev

# README

BetterErrors

Overview

BetterErrors is a GoLang package that provides a more beautiful and effective way to handle and display errors in your applications. It includes functions for logging detailed error information, recovering from panics, and printing general user information.

Features

  • LogError: Log detailed error information with runtime details.
  • RecoverFromPanic: Recover from panics and log panic details.
  • PrintInfo: Print general information about the user.

Usage

Installation

go get -u github.com/9dl/BetterErrors

Example

package main

var logger = BetterErrors.NewErrorLogger()

import (
	"errors"
	"github.com/9dl/BetterErrors"
)

func main() {
	logger.SetIncludeSensitiveInfo(true)
	someFunction()
	// ... rest of your code ...
}

func someFunction()  {
	logger.LogError(errors.New("Hello!"))
}

License

This project is licensed under the MIT License - see the LICENSE file for details.