journal

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string
const (
	DiscoveredFile     Action = "File"
	ScannedImage       Action = "Scanned image"
	ScannedVideo       Action = "Scanned video"
	Discarded          Action = "Discarded"
	Uploaded           Action = "Uploaded"
	Upgraded           Action = "Server's asset upgraded"
	ERROR              Action = "Error"
	LocalDuplicate     Action = "Local duplicate"
	ServerDuplicate    Action = "Server has photo"
	Stacked            Action = "Stacked"
	ServerBetter       Action = "Server's asset is better"
	Album              Action = "Added to an album"
	LivePhoto          Action = "Live photo"
	FailedVideo        Action = "Failed video"
	Unsupported        Action = "File type not supported"
	Metadata           Action = "Metadata files"
	AssociatedMetadata Action = "Associated with metadata"
	INFO               Action = "Info"
	NotSelected        Action = "Not selected because options"
	ServerError        Action = "Server error"
)

type DebugObject

type DebugObject interface {
	DebugObject() any
}

type Journal

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

func NewJournal

func NewJournal(log Logger) *Journal

func (*Journal) AddEntry

func (j *Journal) AddEntry(file string, action Action, comment ...string)

func (*Journal) Report

func (j *Journal) Report()

type Level

type Level int
const (
	Fatal Level = iota
	Error
	Warning
	OK
	Info
	Debug
)

func StringToLevel

func StringToLevel(s string) (Level, error)

func (Level) String

func (l Level) String() string

type Log

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

func NewLogger

func NewLogger(displayLevel Level, noColors bool, debug bool) *Log

func (*Log) Close

func (l *Log) Close() error

func (*Log) Debug

func (l *Log) Debug(f string, v ...any)

func (*Log) DebugObject

func (l *Log) DebugObject(name string, v any)

func (*Log) Error

func (l *Log) Error(f string, v ...any)

func (*Log) Fatal

func (l *Log) Fatal(f string, v ...any)

func (*Log) Info

func (l *Log) Info(f string, v ...any)

func (*Log) Message

func (l *Log) Message(level Level, f string, v ...any)

func (*Log) MessageContinue

func (l *Log) MessageContinue(level Level, f string, v ...any)

func (*Log) MessageTerminate

func (l *Log) MessageTerminate(level Level, f string, v ...any)

func (*Log) OK

func (l *Log) OK(f string, v ...any)

func (*Log) Progress

func (l *Log) Progress(level Level, f string, v ...any)

func (*Log) SetColors

func (l *Log) SetColors(flag bool)

func (*Log) SetDebugFlag

func (l *Log) SetDebugFlag(flag bool)

func (*Log) SetLevel

func (l *Log) SetLevel(level Level)

func (*Log) SetWriter

func (l *Log) SetWriter(w io.WriteCloser)

func (*Log) Warning

func (l *Log) Warning(f string, v ...any)

type Logger

type Logger interface {
	Debug(f string, v ...any)
	DebugObject(name string, v any)
	Info(f string, v ...any)
	OK(f string, v ...any)
	Warning(f string, v ...any)
	Error(f string, v ...any)
	Fatal(f string, v ...any)
	Message(level Level, f string, v ...any)
	Progress(level Level, f string, v ...any)
	MessageContinue(level Level, f string, v ...any)
	MessageTerminate(level Level, f string, v ...any)
	SetWriter(io.WriteCloser)
	SetLevel(Level)
	SetColors(bool)
	SetDebugFlag(bool)
}

type NoLog

type NoLog struct{}

func (NoLog) Debug

func (NoLog) Debug(f string, v ...any)

func (NoLog) DebugObject

func (NoLog) DebugObject(name string, v any)

func (NoLog) Error

func (NoLog) Error(f string, v ...any)

func (NoLog) Fatal

func (NoLog) Fatal(f string, v ...any)

func (NoLog) Info

func (NoLog) Info(f string, v ...any)

func (NoLog) Message

func (NoLog) Message(level Level, f string, v ...any)

func (NoLog) MessageContinue

func (NoLog) MessageContinue(level Level, f string, v ...any)

func (NoLog) MessageTerminate

func (NoLog) MessageTerminate(level Level, f string, v ...any)

func (NoLog) OK

func (NoLog) OK(f string, v ...any)

func (NoLog) Progress

func (NoLog) Progress(level Level, f string, v ...any)

func (NoLog) SetColors

func (NoLog) SetColors(bool)

func (NoLog) SetDebugFlag

func (NoLog) SetDebugFlag(bool)

func (NoLog) SetLevel

func (NoLog) SetLevel(Level)

func (NoLog) SetWriter

func (NoLog) SetWriter(io.WriteCloser)

func (NoLog) Warning

func (NoLog) Warning(f string, v ...any)

Jump to

Keyboard shortcuts

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