Change print to logger functions and provide context
This commit is contained in:
parent
ef93910f98
commit
957f250665
@ -123,7 +123,7 @@ class Onionr:
|
|||||||
config.set('client.client.port', randomPort, savefile=True)
|
config.set('client.client.port', randomPort, savefile=True)
|
||||||
if type(config.get('client.public.port')) is type(None):
|
if type(config.get('client.public.port')) is type(None):
|
||||||
randomPort = netcontroller.getOpenPort()
|
randomPort = netcontroller.getOpenPort()
|
||||||
print(randomPort)
|
logger.debug('Random port chosen: %s' % randomPort)
|
||||||
config.set('client.public.port', randomPort, savefile=True)
|
config.set('client.public.port', randomPort, savefile=True)
|
||||||
if type(config.get('client.participate')) is type(None):
|
if type(config.get('client.participate')) is type(None):
|
||||||
config.set('client.participate', True, savefile=True)
|
config.set('client.participate', True, savefile=True)
|
||||||
|
@ -46,7 +46,7 @@ def open_home(o_inst):
|
|||||||
logger.error('Onionr seems to not be running (could not get api host)')
|
logger.error('Onionr seems to not be running (could not get api host)')
|
||||||
else:
|
else:
|
||||||
url = 'http://%s/#%s' % (url, o_inst.onionrCore.config.get('client.webpassword'))
|
url = 'http://%s/#%s' % (url, o_inst.onionrCore.config.get('client.webpassword'))
|
||||||
print('If Onionr does not open automatically, use this URL:', url)
|
logger.info('If Onionr does not open automatically, use this URL:\n\n%s' % url)
|
||||||
webbrowser.open_new_tab(url)
|
webbrowser.open_new_tab(url)
|
||||||
|
|
||||||
def get_commands(onionr_inst):
|
def get_commands(onionr_inst):
|
||||||
|
@ -104,7 +104,7 @@ def show_peers(o_inst):
|
|||||||
if not type(peers) is None:
|
if not type(peers) is None:
|
||||||
if peers not in ('', 'failure', None):
|
if peers not in ('', 'failure', None):
|
||||||
if peers != False:
|
if peers != False:
|
||||||
print(peers)
|
logger.info('Peers: %s' % peers)
|
||||||
else:
|
else:
|
||||||
print('Daemon probably not running. Unable to list connected peers.')
|
logger.warn('Daemon probably not running. Unable to list connected peers.')
|
||||||
break
|
break
|
@ -82,12 +82,12 @@ class OnionrCLIUI:
|
|||||||
if self.flow_enabled:
|
if self.flow_enabled:
|
||||||
self.subCommand("flow")
|
self.subCommand("flow")
|
||||||
else:
|
else:
|
||||||
print('Plugin not enabled')
|
logger.warn('flow plugin is not enabled')
|
||||||
elif choice in ("2", "mail"):
|
elif choice in ("2", "mail"):
|
||||||
if self.mail_enabled:
|
if self.mail_enabled:
|
||||||
self.subCommand("mail")
|
self.subCommand("mail")
|
||||||
else:
|
else:
|
||||||
print('Plugin not enabled')
|
logger.warn('mail plugin not enabled')
|
||||||
elif choice in ("3", "file sharing", "file"):
|
elif choice in ("3", "file sharing", "file"):
|
||||||
filename = input("Enter full path to file: ").strip()
|
filename = input("Enter full path to file: ").strip()
|
||||||
self.subCommand("addfile", filename)
|
self.subCommand("addfile", filename)
|
||||||
|
Loading…
Reference in New Issue
Block a user