csLog

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2025 License: MIT Imports: 2 Imported by: 0

README

CsLog

license standard-readme compliant

csLog is a thread-safe log component

Table of Contents

Install

This module depends upon a knowledge of Markdown.

gi

Usage

API

License

MIT © Richard McRichface.

Documentation

Index

Constants

View Source
const (
	DEBUG = iota
	INFO
	WARNING
	ERROR
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultClient

type DefaultClient struct {
}

func (*DefaultClient) DEBUG

func (d *DefaultClient) DEBUG(M ...any) string

func (*DefaultClient) ERROR

func (d *DefaultClient) ERROR(M ...any) string

func (*DefaultClient) INFO

func (d *DefaultClient) INFO(M ...any) string

func (*DefaultClient) Print

func (d *DefaultClient) Print(level int, M ...any) string

func (*DefaultClient) WARN

func (d *DefaultClient) WARN(M ...any) string

type DefaultServer

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

func (*DefaultServer) Close

func (d *DefaultServer) Close()

func (*DefaultServer) FilePath

func (d *DefaultServer) FilePath(path string)

func (*DefaultServer) Out

func (d *DefaultServer) Out(msg string)

func (*DefaultServer) Print

func (d *DefaultServer) Print(log string)

type Log

type Log struct {
	LogClient
	Server LogServer
}

func NewLog

func NewLog(client LogClient, sever LogServer) *Log

func (*Log) DEBUG

func (receiver *Log) DEBUG(M ...any)

func (*Log) ERROR

func (receiver *Log) ERROR(M ...any)

func (*Log) INFO

func (receiver *Log) INFO(M ...any)

func (*Log) SetFilePath

func (receiver *Log) SetFilePath(filePath string) *Log

func (*Log) WARN

func (receiver *Log) WARN(M ...any)

type LogClient

type LogClient interface {
	INFO(...any) string
	WARN(...any) string
	DEBUG(...any) string
	ERROR(...any) string
}

type LogServer

type LogServer interface {
	Out(log string)
	FilePath(path string)
	Close()
	Print(log string)
}

type LogType

type LogType interface {
	GetLog() string
}

Jump to

Keyboard shortcuts

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