Esempio n. 1
0
def initialize(name):
	"""
	Initializes the proxy environment before a new proxy is declared.
	
	The name provided must be a valid and unique network service name.
	See tops.core.network.naming for details.
	"""
	# check the name format (does not check uniqueness)
	from tops.core.network.naming import ResourceName
	name = ResourceName(name)
	# remember our service name
	Proxy.service_name = name
	# initialize our run-time configuration
	config.initialize()
	# initialize the logger
	logging.initialize(name)
	# initialize the archiver
	archiving.initialize(name)
Esempio n. 2
0
# Tests the distributed logging infrastructure
#
# @author David Kirkby, [email protected]
# @date Created 6-Aug-2008
#
# This project is hosted at sdss3.org and tops.googlecode.com

if __name__ == "__main__":

	# load our run-time configuration
	import tops.core.utility.config as config
	verbose = config.initialize()

	import tops.core.network.logging.producer as logging
	
	logging.initialize('log.client.test')

	from time import sleep

	log = logging.getLogger('proxy.tcc')
	log.setLevel(logging.DEBUG)

	extra = { 'SaveContext':True }

	for (level) in (logging.DEBUG,logging.INFO,logging.WARNING,logging.ERROR,logging.CRITICAL):
		log.log(level,"This message has level %s",logging.getLevelName(level),extra=extra)
		sleep(0.5)
		logging.log(level,"This message has level %s",logging.getLevelName(level),extra=extra)
		sleep(0.5)

	try: