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)
|
||||
if type(config.get('client.public.port')) is type(None):
|
||||
randomPort = netcontroller.getOpenPort()
|
||||
print(randomPort)
|
||||
logger.debug('Random port chosen: %s' % randomPort)
|
||||
config.set('client.public.port', randomPort, savefile=True)
|
||||
if type(config.get('client.participate')) is type(None):
|
||||
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)')
|
||||
else:
|
||||
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)
|
||||
|
||||
def get_commands(onionr_inst):
|
||||
|
@ -104,7 +104,7 @@ def show_peers(o_inst):
|
||||
if not type(peers) is None:
|
||||
if peers not in ('', 'failure', None):
|
||||
if peers != False:
|
||||
print(peers)
|
||||
logger.info('Peers: %s' % peers)
|
||||
else:
|
||||
print('Daemon probably not running. Unable to list connected peers.')
|
||||
logger.warn('Daemon probably not running. Unable to list connected peers.')
|
||||
break
|
@ -82,12 +82,12 @@ class OnionrCLIUI:
|
||||
if self.flow_enabled:
|
||||
self.subCommand("flow")
|
||||
else:
|
||||
print('Plugin not enabled')
|
||||
logger.warn('flow plugin is not enabled')
|
||||
elif choice in ("2", "mail"):
|
||||
if self.mail_enabled:
|
||||
self.subCommand("mail")
|
||||
else:
|
||||
print('Plugin not enabled')
|
||||
logger.warn('mail plugin not enabled')
|
||||
elif choice in ("3", "file sharing", "file"):
|
||||
filename = input("Enter full path to file: ").strip()
|
||||
self.subCommand("addfile", filename)
|
||||
|
Loading…
Reference in New Issue
Block a user