logondemand

package module
v0.0.0-...-3c5fdba Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 4 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

logondemand

log on demand for Go.

Example

client:

filename := "logondemand_test"
l, err := logondemand.New(filename)
if err != nil {
    log.Fatalf("New error: %v", err)
}
logger := log.New(l, "", log.Flags()|log.Lshortfile|log.Lmicroseconds)
for {
    logger.Printf("123")
    time.Sleep(1 * time.Second)
}

watch:

filename := "logondemand_test"
err := logondemand.Cat(filename)
if err != nil {
    log.Fatalf("Cat error: %v", err)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cat

func Cat(filename string) error

Cat cat fifo content like shell `cat`. Restart after io.EOF.

func New

func New(filename string) (io.WriteCloser, error)

New create fifo if nessesary, which can be used in `log.New()`

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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