Documentation ¶
Index ¶
- Constants
- Variables
- func CloseConfig()
- func CloseMessageLog() error
- func CreatePidFile(flagPidFile string) error
- func DeletePidFile(flagPidFile string) error
- func FormatByteBuffer(header string, b []byte) string
- func FormatBytes(header string, b []byte, bufferLength int, modSpace int, max int, ...) string
- func LoadConfig(file string, config ConfigInterface, watch bool) error
- func NewError(msgID string, args ...interface{}) error
- func ParseConfig(byteValue []byte, config ConfigInterface) error
- func ReadConfig(file string) ([]byte, error)
- func ReadPidFile(flagPidFile string) (int, error)
- func ServerErrorMessage(msgID string, args ...interface{})
- func ServerMessage(msg string, args ...interface{})
- func ShutdownServer(pidFile string, sleep int)
- func StoreConfig(file string, config ConfigInterface) error
- type ConfigInterface
- type ConfigStoreType
- type Logging
Constants ¶
const LineBreak = "\n"
LineBreak line break for unix
const (
// TimeFormat time format schema
TimeFormat = "2006/01/02 15:04:05.000"
)
Variables ¶
var ActualConfigStoreType = XMLStoreType
ActualConfigStoreType actual config store type
var BuildDate string
BuildDate build date
var BuildVersion string
BuildVersion build version
var DefaultEnvironment = ""
DefaultEnvironment default environment path
var EnableLogCache = true
EnableLogCache enable log cache
var LogLevel = 0
LogLevel defined, 0 - no debug, 1 - debug, 2 - info
var MessageReference = "MSG"
MessageReference default message reference
var OutputMessageMode = true
OutputMessageMode output messages if set
var PidFileLocation = ""
PidFileLocation pid file location for creating the PID file
var Version string
Version component version
Functions ¶
func FormatByteBuffer ¶
FormatByteBuffer formats the byte array to an output with a hexadecimal part, a ASCII part and a EBCDIC converted part of the same data
func FormatBytes ¶
func FormatBytes(header string, b []byte, bufferLength int, modSpace int, max int, showLength bool) string
FormatBytes formats a given byte array and modulo space operator. The modulo space defines the the possition a space is added to the output. The maximum give the maximum characters per line. This function enhance the display with showing the length if showLength is set to true
func LoadConfig ¶
func LoadConfig(file string, config ConfigInterface, watch bool) error
LoadConfig load old XML configuration
func ParseConfig ¶
func ParseConfig(byteValue []byte, config ConfigInterface) error
ParseConfig parse config input with config store type
func ServerErrorMessage ¶
func ServerErrorMessage(msgID string, args ...interface{})
ServerErrorMessage Central output information
func ServerMessage ¶
func ServerMessage(msg string, args ...interface{})
ServerMessage Central output information
func ShutdownServer ¶
ShutdownServer shutdown server reference by PID file
func StoreConfig ¶
func StoreConfig(file string, config ConfigInterface) error
StoreConfig store configuration
Types ¶
type ConfigInterface ¶
type ConfigInterface interface { Logging(interface{}) *Logging SetLogging(*Logging) Default() interface{} Current() interface{} Loaded(interface{}) error IsServer() bool }
ConfigInterface config interface for logging
type ConfigStoreType ¶
type ConfigStoreType byte
ConfigStoreType config store type
const ( // NoStoreType no store type found NoStoreType ConfigStoreType = iota // XMLStoreType using XML to store config XMLStoreType // YAMLStoreType using YAML to store config YAMLStoreType // JSONStoreType using JSON to store config JSONStoreType )
type Logging ¶
type Logging struct { TraceLocation string `xml:"directory,attr"` ServerLocation string `xml:"serverlog,attr"` LogLevel string `xml:"level,attr"` MaxSize int `xml:"maxsize,attr"` MaxBackups int `xml:"maxbackups,attr"` MaxAge int `xml:"maxage,attr"` Compress bool `xml:"compress,attr"` }
Logging contains log parameters
func (*Logging) InitTraceLogging ¶
func (xlog *Logging) InitTraceLogging()
InitTraceLogging init trace logging with log level
func (*Logging) OpenMessageLog ¶
func (xlog *Logging) OpenMessageLog()
OpenMessageLog Open message log