Changeset 633
- Timestamp:
- 03/13/07 23:57:18 (18 months ago)
- Files:
-
- 1 modified
-
branches/newnet/museekd/museekd/main.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newnet/museekd/museekd/main.cpp
r630 r633 49 49 }; 50 50 51 class KeySetCallback : public NewNet::Event<const Museek::ConfigManager::ChangeNotify *>::Callback 52 { 53 public: 54 virtual void operator()(const Museek::ConfigManager::ChangeNotify * notice) 55 { 56 if(notice->domain == "museekd.debug") 57 { 58 if(museekd->config()->getBool(notice->domain, notice->key)) 59 NNLOG.enable(notice->key); 60 else 61 NNLOG.disable(notice->key); 62 } 63 } 64 }; 65 66 class KeyRemovedCallback : public NewNet::Event<const Museek::ConfigManager::RemoveNotify *>::Callback 67 { 68 public: 69 virtual void operator()(const Museek::ConfigManager::RemoveNotify * notice) 70 { 71 if(notice->domain == "museekd.debug") 72 NNLOG.disable(notice->key); 73 } 74 }; 75 51 76 int main(int argc, char ** argv) 52 77 { 53 78 /* Enable various interesting logging domains. */ 54 NNLOG.enable("museek.warn"); 55 NNLOG.enable("museek.note"); 56 NNLOG.enable("museek.debug"); 57 // NNLOG.enable("museek.direntry"); 58 NNLOG.enable("museek.messages.iface"); 59 NNLOG.enable("museek.messages.server"); 60 NNLOG.enable("museek.messages.handshake"); 61 NNLOG.enable("museek.messages.peer"); 79 NNLOG.enable("ALL"); 62 80 63 81 /* Create our Museek Daemon instance. */ 64 82 museekd = new Museek::Museekd(); 83 84 /* Connect our config watchers. */ 85 museekd->config()->keySetEvent.connect(new KeySetCallback); 86 museekd->config()->keyRemovedEvent.connect(new KeyRemovedCallback); 65 87 66 88 /* Load the configuration from ~/.museekd/newnet.xml. */ … … 71 93 return -1; 72 94 } 73 95 96 /* Disable the debug override. */ 97 NNLOG.disable("ALL"); 98 74 99 museekd->LoadShares(); // works, yay ;) 75 100
