cklog

package
v0.0.0-...-212a885 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

* @Author: Wangjun * @Date: 2023-06-29 08:55:27 * @LastEditTime: 2023-09-21 13:25:45 * @LastEditors: Wangjun * @Description: * @FilePath: \golib\cklog\cklog.go * hnxr

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

*

  • @description: 关闭写入ck
  • @return {*}

func Log

func Log(level int, traceID string, msg string, UsedTime ...int32)

*

  • @description: 写入日志
  • @param {int} level
  • @param {string} traceID
  • @param {string} msg
  • @return {*}

func SetDB

func SetDB(db *gorm.DB)

*

  • @description: 设置数据库
  • @param {*gorm.DB} db
  • @return {*}

func SetDsn

func SetDsn(dsn string) (err error)

*

  • @description: 设置DSN
  • @param {string} dsn
  • @return {*}

func Setup

func Setup(dsn ...string)

*

  • @description: 初始化
  • @param {...string} dsn
  • @return {*}

Types

type CkLog

type CkLog struct {
	// contains filtered or unexported fields
}

func (*CkLog) Close

func (m *CkLog) Close()

func (*CkLog) Insert

func (m *CkLog) Insert(sql string, rows [][]interface{}) (count int, err error)

func (*CkLog) InsertObjects

func (m *CkLog) InsertObjects(rows interface{}) (count int, err error)

func (*CkLog) SetDB

func (m *CkLog) SetDB(db *gorm.DB)

func (*CkLog) SetDsn

func (m *CkLog) SetDsn(dsn string) (err error)

func (*CkLog) Setup

func (m *CkLog) Setup(dsn ...string)

dsn=tcp://10.202.10.174:9000?database=hnxr&username=default&password=E35E00DF%23&compress=0

func (*CkLog) WriteString

func (m *CkLog) WriteString(level int, traceID string, msg string, UsedTime ...int32)

type Logs

type Logs struct {
	App      string
	Ts       easy.Time
	Level    int
	TraceID  string
	Msg      string
	UsedTime int32 //耗时
}

Jump to

Keyboard shortcuts

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