logger

package module
v0.0.0-...-0e4b343 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: MIT Imports: 6 Imported by: 3

README

Logger

📋🦄 Colorful command-line logger

Usage

package main

import (
	"github.com/mineway/logger"
)

func main() {
	// Define log directory location
	logger.SetLogLocation("/var/log/logger")
	
	logger.Fatal("Hello world from %s !", "README.md")
	// Result => [20:10:15][fatal] Hello world from README.md !
	//           os exit (1)

	logger.Error("Hello world from %s !", "README.md")
	// Result => [20:10:15][error] Hello world from README.md !

	logger.Warning("Hello world from %s !", "README.md")
	// Result => [20:10:15][warning] Hello world from README.md !

	logger.Info("Hello world from %s !", "README.md")
	// Result => [20:10:15][info] Hello world from README.md !

	logger.Success("Hello world from %s !", "README.md")
	// Result => [20:10:15][success] Hello world from README.md !

	logger.Log("Hello world from %s !", "README.md")
	// Result => [20:10:15][log] Hello world from README.md !
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(format string, a ...interface{})

func Fatal

func Fatal(format string, a ...interface{})

func Info

func Info(format string, a ...interface{})

func Log

func Log(format string, a ...interface{})

func SetLogLocation

func SetLogLocation(path string)

func Success

func Success(format string, a ...interface{})

func Warning

func Warning(format string, a ...interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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