Description

RegisterReceiver records a custom receiver type, identified by a value of that type (second argument), under the specified name. Registered names can be used in the "name" attribute of <custom> config items.

RegisterReceiver takes the type of the receiver argument, without taking the value into the account. So do NOT enter any data to the second argument and only call it like:

RegisterReceiver("somename", &MyReceiverType{})

After that, when a '<custom>' config tag with this name is used, a receiver of the specified type would be instantiated. Check CustomReceiver comments for interface details.

NOTE 1: RegisterReceiver fails if you attempt to register different types with the same name.

NOTE 2: RegisterReceiver registers those receivers that must be used in the configuration files (<custom> items). Basically it is just the way you tell seelog config parser what should it do when it meets a <custom> tag with a specific name and data attributes.

But If you are only using seelog as a proxy to an already instantiated CustomReceiver (via LoggerFromCustomReceiver func), you should not call RegisterReceiver.

RegisterReceiver is referenced in 3 repositories

github.com/cihub/seelog github.com/hailocab/platform-layer

...