Show
Ignore:
Timestamp:
08/26/08 17:37:16 (4 months ago)
Author:
dunker@…
Branch:
default
Message:

improve logging .. gozernet backup

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gozerbot/net/cloud.py

    r2253 r2254  
    55__copyright__ = 'this file is in the public domain' 
    66 
    7 from gozerbot.generic import rlog 
     7from gozerbot.generic import rlog, whichmodule 
    88from gozerbot.persiststate import PersistState 
    99from gozerbot.net.client import Client 
     
    1111from gozerbot.thr import start_new_thread 
    1212from gozerbot.datadir import datadir 
    13 from gozerbot.net.server import server 
    1413from gozerbot.contrib.simplejson import dumps 
    1514import asyncore, time, os 
     
    8483        if persist: 
    8584            self.persist(name, url) 
    86         rlog(10, 'net.cloud', 'added %s node <%s>' % (name, url)) 
     85        rlog(10, whichmodule(), 'added %s node <%s>' % (name, url)) 
    8786        return self.nodes[url] 
    8887 
    89     def start(self): 
    90         self.boot() 
     88    def start(self, booturl=None): 
     89        self.boot(booturl) 
    9190        for name, url in self.startup['start'].iteritems(): 
    9291            self.add(name, url) 
    93         self.joinall() 
    94  
     92             
    9593    def persist(self, name, url): 
    9694        self.startup.set('start', name, url) 
     
    159157            client = Client("%s/gozernet/+join/" % url).addcb(cb)                 
    160158        else: 
    161             client = Client('http://213.196.7.59:10101/gozernet/+join/').addcb(cb) 
     159            client = Client('http://gozerbot.org:10101/gozernet/+join/').addcb(cb) 
    162160        client.add(name=name, port=port) 
    163  
    164     def joinall(self): 
    165         for item in self.nodes.values(): 
    166             self.join(item.url) 
    167         start_new_thread(asyncore.loop, (), {'use_poll': True }) 
    168161 
    169162    def boot(self, node=None): 
     
    186179        def cb(client, result): 
    187180            if result.error: 
    188                 rlog(10, self.url, "can't sync: %s" % result.error) 
     181                rlog(10, url, "can't sync: %s" % result.error) 
    189182                return 
    190183            for node in result.data: