Log

package
v0.0.0-...-9f3ac12 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 2 Imported by: 0

README

LogHelper

Description

LogHelper is a simple yet powerful Go package for managing logs in your applications. It provides functions to display log messages with different severity levels, each with its own color for better readability in the console.

Fonctionnalités

  • Automatic timestamp for each log message
  • Three log levels: Error, Info, and Debug
  • Message coloring for better visibility:
    • Error : Red
    • Info : White (default)
    • Debug : Green

Example :

    Log.Infos("Test")

or

    Log.Infos(fmt.Sprintf("%v", err))

Same things with the other type :

    Log.Error("error")
    Log.Debug("error")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogHelper

type LogHelper struct {
}
var Log LogHelper

func (*LogHelper) Debug

func (l *LogHelper) Debug(message string, err ...error)

Make the text green

func (*LogHelper) Error

func (l *LogHelper) Error(message string, err ...error)

Make the text red

func (*LogHelper) Infos

func (l *LogHelper) Infos(message string, err ...error)

Make the text white (normal)

Jump to

Keyboard shortcuts

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