logger

package
v0.0.0-...-7b7b160 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	Id              int       `db:"id,omitempty"`
	ParticipantId   string    `db:"participant_id"`
	ExecutedCommand string    `db:"executed_command"`
	ErrorType       string    `db:"error_type"`
	ErrorCode       int       `db:"error_code"`
	ErrorMessage    string    `db:"error_message"`
	ErrorLine       int       `db:"error_line"`
	ErrorColumn     int       `db:"error_column"`
	GeneratedOutput string    `db:"generated_output"`
	FilePath        string    `db:"file_path"`
	FileVersion     int       `db:"file_version"`
	CreatedAt       *NullTime `db:"created_at,omitempty"`
}

type LogEntryIterator

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

Implement a streaming iterator for log entries This will allow us to iterate through the log entries without loading all of them into memory This is useful for large logs

func (*LogEntryIterator) List

func (it *LogEntryIterator) List() ([]LogEntry, error)

func (*LogEntryIterator) Next

func (it *LogEntryIterator) Next() bool

func (*LogEntryIterator) Value

func (it *LogEntryIterator) Value() (LogEntry, error)

type Logger

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

func NewLogger

func NewLogger() (*Logger, error)

func NewLoggerFromPath

func NewLoggerFromPath(path string) (*Logger, error)

func NewLoggerFromPathPanic

func NewLoggerFromPathPanic(path string) *Logger

func NewLoggerPanic

func NewLoggerPanic() *Logger

func NewMemoryLogger

func NewMemoryLogger() (*Logger, error)

func NewMemoryLoggerPanic

func NewMemoryLoggerPanic() *Logger

func (*Logger) AddSetting

func (log *Logger) AddSetting(key, value string) error

func (*Logger) Close

func (log *Logger) Close() error

func (*Logger) DeleteFile

func (log *Logger) DeleteFile(filepath string) error

func (*Logger) DeleteSetting

func (log *Logger) DeleteSetting(key string) error

func (*Logger) Entries

func (log *Logger) Entries() (*LogEntryIterator, error)

func (*Logger) EntriesByParticipantId

func (log *Logger) EntriesByParticipantId(participantId string) (*LogEntryIterator, error)

func (*Logger) GenerateParticipantId

func (log *Logger) GenerateParticipantId() error

func (*Logger) GenerateSeed

func (log *Logger) GenerateSeed() (int64, error)

func (*Logger) GetSetting

func (log *Logger) GetSetting(key string) (string, error)

func (*Logger) LatestVersionFromFile

func (log *Logger) LatestVersionFromFile(filepath string) (int, error)

func (*Logger) Log

func (log *Logger) Log(entry LogEntry) error

func (*Logger) OpenFile

func (log *Logger) OpenFile(filepath string) ([]byte, error)

logger as FS

func (*Logger) OpenVersionedFile

func (log *Logger) OpenVersionedFile(filepath string, file_version int) ([]byte, error)

func (*Logger) ParticipantId

func (log *Logger) ParticipantId() string

func (*Logger) RenameFile

func (log *Logger) RenameFile(oldFilepath, newFilepath string) error

func (*Logger) Reset

func (log *Logger) Reset() error

func (*Logger) Setup

func (log *Logger) Setup() error

func (*Logger) WriteFile

func (log *Logger) WriteFile(filepath string, content []byte) error

func (*Logger) WriteVersionedFile

func (log *Logger) WriteVersionedFile(filepath string, content []byte, file_version int) error

type NullTime

type NullTime struct {
	Time  time.Time
	Valid bool // Valid is true if Time is not NULL
}

func (*NullTime) Scan

func (nt *NullTime) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTime) Value

func (nt NullTime) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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