2014-04-26 09:18:56 +00:00
|
|
|
package Log
|
|
|
|
|
2014-10-19 17:19:11 +00:00
|
|
|
import (
|
|
|
|
"github.com/SommerEngineering/Ocean/Log/Device"
|
|
|
|
)
|
2014-04-26 09:18:56 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Registering the logging devices. Normally, it is not necessary to call this function. To enable or disable a logging device,
|
|
|
|
please use the configuration database instead. But if you create your own logging device, let say a e-mail logger, then you
|
|
|
|
are able to use this function to activate your own logging device. It is save to use this function at any time and it is
|
|
|
|
thread-save ;-)
|
|
|
|
*/
|
|
|
|
func AddLoggingDevice(device Device.Device) {
|
|
|
|
|
|
|
|
newDevice := device
|
|
|
|
go func() {
|
|
|
|
mutexDevices.Lock()
|
|
|
|
devices.PushBack(newDevice)
|
|
|
|
mutexDevices.Unlock()
|
|
|
|
}()
|
|
|
|
}
|