Commit 0fdb797 1 parent 1705324 commit 0fdb797 Copy full SHA for 0fdb797
File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
import logging
2
+ import os
2
3
import sys
3
4
4
5
import click
8
9
import joft .utils
9
10
10
11
12
+ if os .getenv ("JOFT_DEBUG" ):
13
+ logging_level = logging .DEBUG
14
+ else :
15
+ logging_level = logging .WARNING
16
+
17
+
11
18
@click .group ()
12
19
@click .pass_context
13
20
def main (ctx ) -> None :
@@ -26,7 +33,7 @@ def validate(template) -> int:
26
33
@click .option ("--template" , help = "File path to the template file." )
27
34
@click .pass_obj
28
35
def run (ctx , template : str ) -> int :
29
- logging .basicConfig (format = "%(levelname)s:%(message)s" , level = logging . DEBUG )
36
+ logging .basicConfig (format = "%(levelname)s:%(message)s" , level = logging_level )
30
37
logging .info (
31
38
f"Establishing session with jira server: { ctx ['jira' ]['server' ]['hostname' ]} :"
32
39
)
@@ -47,7 +54,7 @@ def run(ctx, template: str) -> int:
47
54
@click .option ("--template" , help = "File path to the template file." )
48
55
@click .pass_obj
49
56
def list_issues (ctx , template : str ) -> None :
50
- logging .basicConfig (format = "%(levelname)s:%(message)s" , level = logging . DEBUG )
57
+ logging .basicConfig (format = "%(levelname)s:%(message)s" , level = logging_level )
51
58
logging .info (
52
59
f"Establishing session with jira server: { ctx ['jira' ]['server' ]['hostname' ]} :"
53
60
)
You can’t perform that action at this time.
0 commit comments