Skip to content

Commit c283437

Browse files
committed
Used env.is_debug_mode() in log.debug()
1 parent fa7dcd3 commit c283437

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

  • remove-json-keys/src/remove_json_keys/lib
  • translate-messages/src/translate_messages/lib

remove-json-keys/src/remove_json_keys/lib/log.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Dict, List, Optional
55
if sys.platform == 'win32' : import colorama ; colorama.init() # enable ANSI color support
66

7-
from . import data as datalib, pkg, settings
7+
from . import data as datalib, env, pkg, settings
88

99
try : terminal_width = os.get_terminal_size()[0]
1010
except OSError : terminal_width = 80
@@ -72,7 +72,7 @@ def cmd_docs_url_exit(cli: sn, msg: str = '', cmd: str = 'help') -> None:
7272
sys.exit(1)
7373

7474
def debug(msg: str, cli: Optional[sn] = None, *args, **kwargs) -> None:
75-
if '--debug' not in sys.argv[1:]: return
75+
if not env.is_debug_mode() : return
7676

7777
# Init --debug [target]
7878
debug_key=None

translate-messages/src/translate_messages/lib/log.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Dict, List, Optional
55
if sys.platform == 'win32' : import colorama ; colorama.init() # enable ANSI color support
66

7-
from . import data as datalib, pkg, settings
7+
from . import data as datalib, env, pkg, settings
88

99
try : terminal_width = os.get_terminal_size()[0]
1010
except OSError : terminal_width = 80
@@ -72,7 +72,7 @@ def cmd_docs_url_exit(cli: sn, msg: str = '', cmd: str = 'help') -> None:
7272
sys.exit(1)
7373

7474
def debug(msg: str, cli: Optional[sn] = None, *args, **kwargs) -> None:
75-
if '--debug' not in sys.argv[1:]: return
75+
if not env.is_debug_mode() : return
7676

7777
# Init --debug [target]
7878
debug_key=None

0 commit comments

Comments
 (0)