From a5b332a28b25d0f333a9dba92d484f1b063e84a0 Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Tue, 31 Jul 2012 01:47:52 +0200 Subject: print plugin loading into logs --- plugin-loader.vala | 44 ++++++++++++++++++++++---------------------- 1 file 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 : 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); + } } -- cgit v1.2.3