vslog

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

Vslog - Very simple log

Flags

STDOUT: Logs to the OS Stdout output

STDERR: Logs to the OS Stderr output

FILE: Create a Logs directory and inside a folder with the logger name

Usage

package main

import "github.com/juanleung/vslog"

func main() {
  logger, err := vslog.GetLogger("LogName", vslog.STDOUT|vslog.FILE)
  logger.Info("A very simple logger")
}

Documentation

Index

Constants

View Source
const (
	STDOUT = 1 << iota
	STDERR
	FILE
)

Constant that define where the logger will be writing

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is the logging object

func GetLogger

func GetLogger(name string, flags int) (*Logger, error)

GetLogger is a function that create a new logger

func (*Logger) Error

func (l *Logger) Error(message string)

Error register a log message with Error level

func (*Logger) Errorf

func (l *Logger) Errorf(message string, a ...interface{})

Errorf register a log message with string interpolation and Error level

func (*Logger) Info

func (l *Logger) Info(message string)

Info register a log message with Info level

func (*Logger) Infof

func (l *Logger) Infof(message string, a ...interface{})

Infof register a log message with string interpolation and Info level

Jump to

Keyboard shortcuts

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