Documentation
¶
Overview ¶
Package omppLog to println messages to standard output and log file. It is intended for progress or error logging and should not be used for profiling (it is slow).
Log can be enabled/disabled for two independent streams:
console => standard output stream log file => log file, truncated on every run, (optional) unique "stamped" name
"Stamped" file name produced by adding time-stamp and/or pid-stamp, i.e.:
exeName.log => exeName.2012_08_17_16_04_59_148.123.log
Index ¶
- func LoadMessageIni(exeName, exeDir string, userLang string, encodingName string) (string, []string, error)
- func Log(msg ...any)
- func LogFmt(format string, msg ...any)
- func LogFmtNoLT(format string, msg ...any)
- func LogIfTime(lastT int64, nSeconds int64, msg ...any) int64
- func LogNoLT(msg ...any)
- func LogSql(sql string)
- func New(opts *config.LogOptions)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadMessageIni ¶ added in v1.17.10
func LoadMessageIni(exeName, exeDir string, userLang string, encodingName string) (string, []string, error)
Load translated messages from language sections of exeName.message.ini go-common.message.ini files. It is a merge of exeName.message.ini and go.common.message.ini. If exeName is empty or exeName.message.ini file not exist then do nothing
func Log ¶
func Log(msg ...any)
Log message to console and log file, put space between msg items, translate first msg[0] item using message.ini content, use language specific msgPrt printer instead of fmt by default
func LogFmt ¶ added in v1.17.10
log formattted message to console and log file, translate format string using message.ini content, use language specific msgPrt printer instead of fmt by default
func LogFmtNoLT ¶ added in v1.17.10
log formattted message to console and log file,
func LogIfTime ¶ added in v1.9.7
LogIfTime do Log(msg) not more often then every nSeconds. It does nothing if time now < lastT + nSeconds. Time is a Unix time, seconds since epoch.
Types ¶
This section is empty.