Example #1
0
// Initialize default log settings
func init() {
	// Карта всех копий logger
	singleton = make(map[string]Log)

	// Устанавливаем в зависимые пакеты функции информирования об ошибках
	b.LogError = Error

	// Defailt backend format
	b.DefaultFormat = default_FORMAT

	// Default public log object
	var uuid, _ = u.ParseUUID(default_LOGUUID)
	singleton[default_LOGUUID] = newLogEssence(uuid)
}
Example #2
0
// Close logging
func (log *LogEssence) Close() (err error) {
	// Reset standard logging to default settings
	log.InterceptStandardLog(false)
	log.defaultLevelLogWriter = nil

	// Block programm while goroutine exit
	log.backend.Close()

	// Create new backend object, old object automatic call Stop all backend and destroy
	log.backend = b.NewBackends()

	// Reinitialisation
	var uuid, _ = u.ParseUUID(default_LOGUUID)
	singleton[default_LOGUUID] = newLogEssence(uuid)

	runtime.GC()
	runtime.Gosched()
	return
}
Example #3
0
// Close logging and reinitialisation defailt log
func Close() (err error) {
	var uuid, _ = u.ParseUUID(default_LOGUUID)
	singleton[default_LOGUUID].Close()
	singleton[default_LOGUUID] = newLogEssence(uuid)
	return
}