Documentation
¶
Overview ¶
Package common provides constants, variables and functions used throughout the application.
Index ¶
Constants ¶
const ( Debug = true Version = "0.0.1" AppName = "Rolodex" TimestampFormat = "2006-01-02 15:04:05" TimestampFormatMinute = "2006-01-02 15:04" TimestampFormatSubSecond = "2006-01-02 15:04:05.0000 MST" TimestampFormatDate = "2006-01-02" HeartBeat = time.Millisecond * 500 RCTimeout = time.Millisecond * 10 )
Debug indicated whether to emit additional log messages and perform additional sanity checks. Version is the version number to display. AppName is the name of the application. TimestampFormat is the format string used to render datetime values. HeartBeat is the interval for worker goroutines to wake up and check their status.
const MinLogLevel = "TRACE"
Variables ¶
var ( BaseDir = filepath.Join(os.Getenv("HOME"), ".rolodex.d") LogPath = filepath.Join(BaseDir, "rolodex.log") DbPath = filepath.Join(BaseDir, "rolodex.db") )
BaseDir is the folder where all application-specific files (database, log files, etc) are stored. LogPath is the file to the log path. DbPath is the path of the main database. HostCachePath is the path to the IP cache. XfrDbgPath is the path of the folder where data on DNS zone transfers are stored.
var LogLevels = []logutils.LogLevel{
"TRACE",
"DEBUG",
"INFO",
"WARN",
"ERROR",
"CRITICAL",
"CANTHAPPEN",
"SILENT",
}
LogLevels are the names of the log levels supported by the logger.
var PackageLevels = make(map[logfacility.ID]logutils.LogLevel, len(LogLevels))
PackageLevels defines minimum log levels per package.
Functions ¶
func GetChecksum ¶
GetChecksum computes the SHA512 checksum of the given data.
func GetLogger ¶
func GetLogger(id logfacility.ID) (*log.Logger, error)
GetLogger Tries to create a named logger instance and return it. If the directory to hold the log file does not exist, try to create it.
Types ¶
This section is empty.
Directories
¶
Path | Synopsis |
---|---|
Package logfacility provides symbolic constants for the various parts of the application that might want to do logging.
|
Package logfacility provides symbolic constants for the various parts of the application that might want to do logging. |