glog

package module
v0.0.0-...-53da4cb Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: Apache-2.0 Imports: 4 Imported by: 1

README

ghost-log

log library in great-ghost

Documentation

Overview

Example
package main

import (
	"errors"
)

type obj struct {
	*Log
}

func main() {
	defer func() {
		_ = recover()
	}()

	o := &obj{New()}
	//o.Logger = log.New(os.Stderr, "[Example] ", log.LstdFlags)
	o.Logger.SetPrefix("[Example] ")
	o.Mode = Debug
	o.Debug("Hello World")
	o.Info("Hello World")
	o.Warn("Hello World")
	o.Error(errors.New("Hello World"))

}

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	Blue   = color.FgBlue.Render
	Green  = color.FgGreen.Render
	Yellow = color.FgYellow.Render
	Red    = color.FgRed.Render
)

color(s)

Functions

func MultiLogger

func MultiLogger(dir, fileName string, flag int) *log.Logger

MultiLogger Builder

func StopPanic

func StopPanic()

StopPanic util

Types

type Log

type Log struct {
	Mode   LogMode
	Logger *log.Logger
}

Log Wrapper

func New

func New() *Log

New Log

func (*Log) Debug

func (l *Log) Debug(vs ...interface{})

Debug Log

func (*Log) Error

func (l *Log) Error(e error)

Error Log

func (*Log) Info

func (l *Log) Info(vs ...interface{})

Info Log

func (*Log) Log

func (l *Log) Log(prompt string, color func(a ...interface{}) string, vs ...interface{})

Log Action

func (*Log) Warn

func (l *Log) Warn(vs ...interface{})

Warn Log

type LogMode

type LogMode uint8

LogMode for vos/session

const (
	No LogMode = iota // No Log
	Error
	Warn
	Info
	Debug
)

LogMode

Jump to

Keyboard shortcuts

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