Adding an Android specific logger.

This commit is contained in:
Tobias Brunner
2010-06-15 19:58:58 +02:00
parent 946be4d357
commit 51a00fb275
4 changed files with 163 additions and 3 deletions
+13 -2
View File
@@ -14,6 +14,7 @@
*/
#include "android_plugin.h"
#include "android_logger.h"
#include "android_handler.h"
#include <hydra.h>
@@ -31,6 +32,11 @@ struct private_android_plugin_t {
*/
android_plugin_t public;
/**
* Android specific logger
*/
android_logger_t *logger;
/**
* Android specific DNS handler
*/
@@ -38,10 +44,13 @@ struct private_android_plugin_t {
};
METHOD(plugin_t, destroy, void,
private_android_plugin_t *this)
private_android_plugin_t *this)
{
hydra->attributes->remove_handler(hydra->attributes, &this->handler->handler);
hydra->attributes->remove_handler(hydra->attributes,
&this->handler->handler);
charon->bus->remove_listener(charon->bus, &this->logger->listener);
this->handler->destroy(this->handler);
this->logger->destroy(this->logger);
free(this);
}
@@ -56,9 +65,11 @@ plugin_t *android_plugin_create()
.public.plugin = {
.destroy = _destroy,
},
.logger = android_logger_create(),
.handler = android_handler_create(),
);
charon->bus->add_listener(charon->bus, &this->logger->listener);
hydra->attributes->add_handler(hydra->attributes, &this->handler->handler);
return &this->public.plugin;