heavyfishdesign: github.com/dustismo/heavyfishdesign/util Index | Files

package util

import "github.com/dustismo/heavyfishdesign/util"


Package Files

file.go logging.go

func ClearDir Uses

func ClearDir(directory, extension string) error

deletes all files of the given type from the requested directory this operates recursively, but does not remove the empty directories

func DirectoryList Uses

func DirectoryList(directory string) ([]string, error)

recursively list the directories

func FileList Uses

func FileList(directory string, extension string) ([]string, error)

Filenames will have the passed in directory as a prefix: for instance: FileList("static", "hfd") static/hfd/shelf/four_sided_shelf_with_divider.hfd static/hfd/shelf/three_sided_shelf.hfd static/hfd/shelf/three_sided_shelf_with_divider.hfd

func RelFileList Uses

func RelFileList(directory string, extension string) ([]string, error)

Same as FileList, but strips the requested directory prefix. for instance: FileList("static", "hfd") hfd/shelf/four_sided_shelf_with_divider.hfd hfd/shelf/three_sided_shelf.hfd hfd/shelf/three_sided_shelf_with_divider.hfd

type HfdLog Uses

type HfdLog struct {

    // should we also write messages to std out?
    LogToStdOut LogLevel
    Messages    []LogMessage
    // these fields will be added to all log messages
    StaticFields *dynmap.DynMap
    // contains filtered or unexported fields

This logger is intended to serve a single Render operation it tracks all log messages in a queue, that can then be displayed to the end user or dropped. if Debug is on, then all messages are written to STD out.

func NewLog Uses

func NewLog() *HfdLog

func (*HfdLog) Debugf Uses

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

func (*HfdLog) Debugfd Uses

func (logger *HfdLog) Debugfd(fields *dynmap.DynMap, format string, v ...interface{})

func (*HfdLog) Errorf Uses

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

func (*HfdLog) Errorfd Uses

func (logger *HfdLog) Errorfd(fields *dynmap.DynMap, format string, v ...interface{})

func (*HfdLog) HasErrors Uses

func (logger *HfdLog) HasErrors() bool

func (*HfdLog) Infof Uses

func (logger *HfdLog) Infof(format string, v ...interface{})

func (*HfdLog) Infofd Uses

func (logger *HfdLog) Infofd(fields *dynmap.DynMap, format string, v ...interface{})

func (*HfdLog) Logf Uses

func (logger *HfdLog) Logf(level LogLevel, fields *dynmap.DynMap, format string, v ...interface{})

func (*HfdLog) NewChild Uses

func (logger *HfdLog) NewChild() *HfdLog

Creates a new logger from this one, that shares many of the same configurations, and anything logged to it, will also be logged to self

type LogLevel Uses

type LogLevel int
const (
    Debug LogLevel = 0
    Info  LogLevel = 1
    Error LogLevel = 2
    Fatal LogLevel = 3

func (LogLevel) String Uses

func (ll LogLevel) String() string

type LogMessage Uses

type LogMessage struct {
    Timestamp time.Time
    Level     LogLevel
    Message   string

func (LogMessage) ToDynMap Uses

func (lm LogMessage) ToDynMap() *dynmap.DynMap

Package util imports 6 packages (graph) and is imported by 3 packages. Updated 2020-07-19. Refresh now. Tools for package owners.