MCPcopy
hub / github.com/onionshare/onionshare / log

Method log

cli/onionshare_cli/common.py:299–310  ·  view source on GitHub ↗

If verbose mode is on, log error messages to stdout

(self, module, func, msg=None)

Source from the content-addressed store, hash-verified

297 self.settings.load()
298
299 def log(self, module, func, msg=None):
300 """
301 If verbose mode is on, log error messages to stdout
302 """
303 if self.verbose:
304 timestamp = time.strftime("%b %d %Y %X")
305 final_msg = f"{Fore.LIGHTBLACK_EX + Style.DIM}[{timestamp}]{Style.RESET_ALL} {Fore.WHITE + Style.DIM}{module}.{func}{Style.RESET_ALL}"
306 if msg:
307 final_msg = (
308 f"{final_msg}{Fore.WHITE + Style.DIM}: {msg}{Style.RESET_ALL}"
309 )
310 print(final_msg)
311
312 def get_resource_path(self, filename):
313 """

Callers 15

get_resource_pathMethod · 0.95
get_tor_pathsMethod · 0.95
check_bridges_validMethod · 0.95
__init__Method · 0.80
check_for_updatesMethod · 0.80
save_clickedMethod · 0.80
help_clickedMethod · 0.80
settings_from_fieldsMethod · 0.80
_disable_buttonsMethod · 0.80
_enable_buttonsMethod · 0.80
__init__Method · 0.80

Calls

no outgoing calls

Tested by 2

test_tor_clickedMethod · 0.64
test_outputMethod · 0.64