gpc

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 12 Imported by: 0

README

gpc

介绍

go misc.

软件架构

软件架构说明

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
  1. xxxx
  2. xxxx
  3. xxxx
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogToolsDefault = new(LogTools)

Functions

func BaseName

func BaseName(p string) string

从路径中获取文件基本名(即文件名不包括扩展名)

func Debug

func Debug(v ...interface{})

Debug

func Debugf

func Debugf(format string, v ...interface{})

Debug

func Error

func Error(v ...interface{})

Error

func Errorf

func Errorf(format string, v ...interface{})

Error

func GetSelfFileDir

func GetSelfFileDir() string

获取当前可执行文件目录

func GetSelfFileName

func GetSelfFileName() string

获取当前可执行文件名

func Infor

func Infor(v ...interface{})

Infor

func Inforf

func Inforf(format string, v ...interface{})

Infor

func InitLogTools

func InitLogTools(logconfigFile string) func()

InitLogger 初始化 log,返回关闭log的函数 调用示例:defer myutil.InitLogTools("xxx.ini")() 配置文件示例: [Log] LogFileDirctory=C:\LOG\LogDir LogLevel=DEBUG StdOut=1

func IsExist

func IsExist(p string) bool

IsExist 判断文件或者目录是否存在

func LogBytes

func LogBytes(writelevel LOGLEVEL, b []byte) (n int, err error)

写入字节数组

func LogString

func LogString(writelevel LOGLEVEL, s string)

写入字符串

func Panic

func Panic(v ...interface{})

Panic

func SingletonProcess

func SingletonProcess(mutexName string) func()

单进程模式,建议在main函数第一行调用 调用示例: defer SingletonProcess("mutex name")()

func Warning

func Warning(v ...interface{})

Warning

func Warningf

func Warningf(format string, v ...interface{})

Warning

Types

type LOGLEVEL

type LOGLEVEL int8

日志级别

const (
	LevelDebug LOGLEVEL = iota
	LevelInfo
	LevelWarning
	LevelError
	LevelClose
)

type LogTools

type LogTools struct {
	LogLevel        LOGLEVEL
	LogFileDirctory string
	LogFileName     string
	StdOut          int
	// contains filtered or unexported fields
}

日志对象

func (*LogTools) Write

func (l *LogTools) Write(b []byte) (n int, err error)

实现io.Writer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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