SimpleLogger

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 11 Imported by: 0

README

Simple Logger

It is a simple logger for Go(lang).

Installation

GOSUMDB=off go get git.sacredheart.it/xantios/simple-logger

Usage

package main

func main() {
    logger := new SimpleLogger()
    world := "world"
    logger.Infof("Hello %s",world)
}

Documentation

Index

Constants

View Source
const (
	Black = iota + 30
	Red
	Green
	Yellow
	Blue
	Magenta
	Cyan
	White
)

Little on the magic-side. increments by one, starting at 30

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggerOption

type LoggerOption func(*SimpleLogger)

func WithFilelog

func WithFilelog(file string) LoggerOption

func WithPrefix

func WithPrefix(prefix string) LoggerOption

func WithWebhook

func WithWebhook(webhook string) LoggerOption

type SimpleLogger

type SimpleLogger struct {
	Webhook string
	File    string
	Prefix  string
	LogFile *os.File
}

func New

func New(options ...LoggerOption) *SimpleLogger

func (*SimpleLogger) Debug

func (logger *SimpleLogger) Debug(format string, v ...interface{})

func (*SimpleLogger) Debugf

func (logger *SimpleLogger) Debugf(format string, v ...interface{})

func (*SimpleLogger) Error

func (logger *SimpleLogger) Error(format string, v ...interface{})

func (*SimpleLogger) Errorf

func (logger *SimpleLogger) Errorf(format string, v ...interface{})

func (*SimpleLogger) Fatal

func (logger *SimpleLogger) Fatal(format string, v ...interface{})

func (*SimpleLogger) Fatalf

func (logger *SimpleLogger) Fatalf(format string, v ...interface{})

func (*SimpleLogger) Info

func (logger *SimpleLogger) Info(format string, v ...interface{})

func (*SimpleLogger) Infof

func (logger *SimpleLogger) Infof(format string, v ...interface{})

func (*SimpleLogger) Panic

func (logger *SimpleLogger) Panic(format string, v ...interface{})

func (*SimpleLogger) Panicf

func (logger *SimpleLogger) Panicf(format string, v ...interface{})

func (*SimpleLogger) Warn

func (logger *SimpleLogger) Warn(format string, v ...interface{})

func (*SimpleLogger) Warnf

func (logger *SimpleLogger) Warnf(format string, v ...interface{})

type WebhookRequest

type WebhookRequest struct {
	Prefix   string `json:"prefix"`
	Log      string `json:"log"`
	File     string `json:"file"`
	Line     int    `json:"line"`
	Severity string `json:"Severity"`
}

Jump to

Keyboard shortcuts

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