Documentation
¶
Overview ¶
Example ¶
package main
import (
"fmt"
"os"
"github.com/go-logr/logr"
"github.com/go-logr/zapr"
"github.com/task4233/dl"
"go.uber.org/zap"
)
func main() {
num := 123
name := "dl"
type MyInt int
var myNum MyInt = 123
dl.Fprintln(os.Stdout, "num: ", num)
dl.Println("num: ", num)
dl.Fprintf(os.Stdout, "name: %s\n", name)
dl.Printf("name: %s", name)
dl.FInfo(os.Stdout, myNum)
dl.Info(myNum)
zapLog, err := zap.NewDevelopment()
if err != nil {
panic(fmt.Sprintf("who watches the watchmen (%v)?", err))
}
var log logr.Logger = zapr.NewLogger(zapLog)
dlr := dl.NewLogger(&log)
dlr.Info("Info: ", "num", num)
}
Output: num: 123 name: dl [DeLog] info: 123 (dl_test.MyInt) log_example_test.go:23
Index ¶
- func FInfo[T any](w io.Writer, v T) (int, error)
- func Fprintf(w io.Writer, format string, v ...any) (int, error)
- func Fprintln(w io.Writer, v ...any) (int, error)
- func Info[T any](v T) (int, error)
- func Printf(format string, v ...any) (int, error)
- func Println(v ...any) (int, error)
- type Clean
- type Cmd
- type DeLog
- type Init
- type IntHeap
- type Logger
- type Remove
- type Restore
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fprintf ¶
Fprintf formats according to a format specifier and writes to w. Arguments are handled in the manner of fmt.FPrintf.
func Fprintln ¶
Fprintln formats using the default formats for its operands and writes to w. Spaces are always added between operands and a newline is appended. Arguments are handled in the manner of fmt.FPrintln.
Types ¶
type Clean ¶ added in v0.5.5
type Clean struct {
// contains filtered or unexported fields
}
func (*Clean) Evacuate ¶ added in v0.5.5
Evacuate copies ".go" files to under ".dl" directory. This method requires ".dl" directory to exist. This method doesn't allow to invoke with a file included in `excludeFiles`.
Click to show internal directories.
Click to hide internal directories.
