ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/zoe/trunk/Zoe.cpp
(Generate patch)

Comparing trunk/Zoe.cpp (file contents):
Revision 59 by douglas, 2004-09-13T23:39:30-07:00 vs.
Revision 60 by douglas, 2004-09-15T19:43:29-07:00

# Line 67 | Line 67 | Zoe::Zoe()
67          if (!(collector || publisher)) usage();
68          
69          configure();
70        initialize();
70  
71          Collector collector(login, password, buddies, database, Zoe::collector);
72          Publisher publisher(buddies, database, Zoe::publisher);
# Line 79 | Line 78 | ext::String Zoe::program, Zoe::config("z
78  
79   void Zoe::usage()
80   {
81 <        cerr << "Usage: " << Zoe::program << " [-config=config] [-collector] "
81 >        api::Cerr << "Usage: " << Zoe::program << " [-config=config] [-collector] "
82                  "[-publisher] [-color] [-D]\n";
83  
84          exit(1);
# Line 124 | Line 123 | ext::String Zoe::generator(Generator gen
123  
124   void Zoe::configure()
125   {
126 <        if (debug) cerr << "config = " << config << '\n';
126 >        if (debug) api::Cerr << "config = " << config << "\n";
127  
128          ext::Handle<xml::Document> document(xml::Parse(config));
129          ext::Handle<xml::Node> zoe(*document/"zoe");
# Line 151 | Line 150 | void Zoe::configure()
150  
151          database.db = *zoe/"database"/"db";
152  
153 <        if (debug) cerr << "login = " << login << "\npassword = "
153 >        if (debug) api::Cerr << "login = " << login << "\npassword = "
154                  << std::string(password.GetSize(), '*') << "\ndatabase = {\n"
155                  << "   driver = " << database.driver << "\n   host = " << database.host
156 <                << "\n   user = " << database.user << '\n'
156 >                << "\n   user = " << database.user << "\n"
157                  << "   password = " << std::string(database.password.GetSize(), '*')
158                  << "\n   db = " << database.db << "\n}\n";
159  
# Line 171 | Line 170 | void Zoe::configure()
170                  this->buddies.insert(buddy_);
171          }
172  
173 +        initialize();
174 +
175          if (debug)
176          {
177 <                cerr << "buddies = {\n";
177 >                api::Cerr << "buddies = {\n";
178  
179                  for (std::set<Buddy>::const_iterator buddy(this->buddies.begin());
180                          buddy != this->buddies.end(); ++buddy)
181                  {
182 <                        cerr << "   " << *buddy << " = {\n      rss = " << buddy->getRss()
183 <                                << "\n      atom = " << buddy->getAtom() << "\n      link = "
184 <                                << buddy->getLink() << "\n   }\n";
182 >                        api::Cerr << "   " << *buddy << " = {\n      rss = "
183 >                                << buddy->getRss() << "\n      atom = " << buddy->getAtom()
184 >                                << "\n      link = " << buddy->getLink() << "\n      id = "
185 >                                << buddy->getId() << "\n   }\n";
186                  }
187  
188 <                cerr << "}\n";
188 >                api::Cerr << "}\n";
189          }
190  
191 <        if (debug) cerr << "collector = " << lexical_cast<ext::String>(collector)
192 <                << "\npublisher = " << lexical_cast<ext::String>(publisher)
191 <                << "\ncolor = " << lexical_cast<ext::String>(color) << '\n';
191 >        if (debug) api::Cerr << "collector = " << collector << "\npublisher = "
192 >                << publisher << "\ncolor = " << color << "\n";
193   }
194  
195   void Zoe::initialize()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines