diff options
| author | npmccallum <npmccallum@c587cffe-e639-0410-9787-d7902ae8ed56> | 2010-02-08 16:29:22 +0000 |
|---|---|---|
| committer | npmccallum <npmccallum@c587cffe-e639-0410-9787-d7902ae8ed56> | 2010-02-08 16:29:22 +0000 |
| commit | 3c7f499c65c8fba7029d6de2ab221fc40e79111c (patch) | |
| tree | 3b99c058353bf847298ce752f56b505226b01e3d /libmodman/module_manager.cpp | |
| parent | 77177e5ff136f0975764713877df272fb6bdbabb (diff) | |
| download | libproxy-3c7f499c65c8fba7029d6de2ab221fc40e79111c.tar.gz | |
make error messages a little cleaner
git-svn-id: http://libproxy.googlecode.com/svn/trunk@523 c587cffe-e639-0410-9787-d7902ae8ed56
Diffstat (limited to 'libmodman/module_manager.cpp')
| -rw-r--r-- | libmodman/module_manager.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/libmodman/module_manager.cpp b/libmodman/module_manager.cpp index 8ce5845..c7fd8a5 100644 --- a/libmodman/module_manager.cpp +++ b/libmodman/module_manager.cpp @@ -86,12 +86,14 @@ bool module_manager::load_file(string filename, bool symbreq) { if (stat(filename.c_str(), &st) != 0) return false; if ((st.st_mode & S_IFMT) != S_IFREG) return false; + if (debug) + cerr << "loading : " << filename << "\r"; + // Open the module pdlmtype dlobj = pdlopen(filename.c_str()); if (!dlobj) { if (debug) { - cerr << "Failed loading module: " << filename << endl; - cerr << pdlerror() << endl; + cerr << "failed!" << endl << "\t" << pdlerror() << endl; } return false; } @@ -105,7 +107,8 @@ bool module_manager::load_file(string filename, bool symbreq) { // Get the module_info struct module* mi = (module*) pdlsym(dlobj, __str(MM_MODULE_NAME)); if (!mi) { - if (debug) cerr << "Unable to find struct " __str(MM_MODULE_NAME) " in module: " << filename << endl; + if (debug) + cerr << "failed!" << endl << "\tUnable to find struct '" __str(MM_MODULE_NAME) "'!" << endl; pdlclose(dlobj); return false; } @@ -151,13 +154,12 @@ bool module_manager::load_file(string filename, bool symbreq) { if (extensions) { // init() returned extensions we need to register loaded = true; + cerr << "success" << endl; for (unsigned int j=0 ; extensions[j] ; j++) { if (debug) - cerr << "Found extension '" - << typeid(*extensions[j]).name() - << "' with base type '" - << mi[i].type - << "'" << endl; + cerr << "\tRegistering " + << typeid(*extensions[j]).name() << "(" + << mi[i].type << ")" << endl; this->extensions[mi[i].type].push_back(extensions[j]); } delete extensions; @@ -167,7 +169,8 @@ bool module_manager::load_file(string filename, bool symbreq) { // We didn't load this module, so exit if (!loaded) { - if (debug) cerr << "Unable to find any suitable extension factories in module: " << filename << endl; + if (debug) + cerr << "failed!" << endl << "\tNo suitable extension factories!" << endl; pdlclose(dlobj); return false; } @@ -176,7 +179,6 @@ bool module_manager::load_file(string filename, bool symbreq) { this->modules.insert((void*) dlobj); // Yay, we did it! - if (debug) cerr << "Successfully loaded module: " << filename << endl; return true; } |
