diff options
author | Sebastian Reichel <sre@ring0.de> | 2012-07-31 01:47:52 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2012-07-31 01:47:52 +0200 |
commit | a5b332a28b25d0f333a9dba92d484f1b063e84a0 (patch) | |
tree | 6cbc269e361f39eeb724abcd0d017b785813a51e | |
parent | 44a70a656c994d1a6edc021355dc506e8a98e7a4 (diff) | |
download | microcopterd-a5b332a28b25d0f333a9dba92d484f1b063e84a0.tar.bz2 |
print plugin loading into logs
-rw-r--r-- | plugin-loader.vala | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/plugin-loader.vala b/plugin-loader.vala index 67070b4..050fdd4 100644 --- a/plugin-loader.vala +++ b/plugin-loader.vala @@ -15,35 +15,35 @@ public class PluginLoader<T> : Object { - public string path { get; private set; } + public string path { get; private set; } - private Type type; - private Module module; + private Type type; + private Module module; - private delegate Type RegisterPluginFunction(Module module); + private delegate Type RegisterPluginFunction(Module module); - public PluginLoader(string path) { - assert(Module.supported()); - this.path = path; - } + public PluginLoader(string path) { + assert(Module.supported()); + this.path = path; + } - public bool load() { - module = Module.open(path, ModuleFlags.BIND_LAZY); - if(module == null) { - return false; - } + public bool load() { + module = Module.open(path, ModuleFlags.BIND_LAZY); + if(module == null) { + return false; + } module.make_resident(); - void* function; - module.symbol("register_plugin", out function); + void* function; + module.symbol("register_plugin", out function); - type = ((RegisterPluginFunction) function)(module); - stdout.printf("Loaded Plugin: %s\n", type.name()); - return true; - } + type = ((RegisterPluginFunction) function)(module); + log("PluginLoader", LogLevelFlags.LEVEL_INFO, "loadedplugin: %s".printf(type.name())); + return true; + } - public T new_object() { - return Object.new (type); - } + public T new_object() { + return Object.new (type); + } } |