logoutput

package module
v0.0.0-...-2e36113 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: BSD-3-Clause Imports: 5 Imported by: 5

README

go-logoutput

GoDoc

A writer that change output file every day

Exemple

Create a directory and the file 2006-01-02.log into.

package main

import (
	"github.com/HuguesGuilleus/go-logoutput"
	"log"
)

func main() {
	logoutput.SetLog("log")
	log.Println("Hello World")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLog

func SetLog(root string)

Set the output of the standard log.

Types

type W

type W struct {
	// The directory taht contains all log file.
	Root string
	// contains filtered or unexported fields
}

A logger output. You can use Zero value.

func New

func New(root string) *W

Create a W writer

func (*W) Write

func (w *W) Write(data []byte) (int, error)

Write the content of data to the day file and into os.Stdout

Jump to

Keyboard shortcuts

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