Example #1
0
	dbus.glib.init_threads()
	while mainloop.is_running():
		try:
			mainloop.run()
		except KeyboardInterrupt:
			quit()


def main(logToFile):
	try:
		os.makedirs(constants._data_path_)
	except OSError, e:
		if e.errno != 17:
			raise

	telepathy_utils.debug_divert_messages(os.getenv('THEONERING_LOGFILE'))
	logFormat = '(%(asctime)s) %(levelname)-5s %(threadName)s.%(name)s: %(message)s'
	logging.basicConfig(
		level=logging.DEBUG,
		format=logFormat,
		datefmt='%H:%M:%S',
	)
	logging.raiseExceptions = True # Getting funky shutdown behavior, checking it out
	rotating = logging.handlers.RotatingFileHandler(constants._user_logpath_, maxBytes=512*1024, backupCount=1)
	rotating.setFormatter(logging.Formatter(logFormat))
	root = logging.getLogger()
	root.addHandler(rotating)
	logging.info("telepathy-theonering %s-%s" % (constants.__version__, constants.__build__))
	logging.debug("OS: %s" % (os.uname()[0], ))
	logging.debug("Kernel: %s (%s) for %s" % os.uname()[2:])
	logging.debug("Hostname: %s" % os.uname()[1])
Example #2
0
	dbus.glib.init_threads()
	while mainloop.is_running():
		try:
			mainloop.run()
		except KeyboardInterrupt:
			quit()


def main(logToFile):
	try:
		os.makedirs(constants._data_path_)
	except OSError, e:
		if e.errno != 17:
			raise

	telepathy_utils.debug_divert_messages(os.getenv('BLUEWIRE_LOGFILE'))
	logFormat = '(%(asctime)s) %(levelname)-5s %(threadName)s.%(name)s: %(message)s'
	if logToFile:
		logging.basicConfig(
			level=logging.DEBUG,
			filename=constants._user_logpath_,
			format=logFormat,
			datefmt='%H:%M:%S',
		)
	else:
		logging.basicConfig(
			level=logging.DEBUG,
			format=logFormat,
			datefmt='%H:%M:%S',
		)
	logging.info("telepathy-bluewire %s-%s" % (constants.__version__, constants.__build__))