Skip to content

Commit 6710f00

Browse files
fix(cli-web): fix logging level not work by add basic config (#418)
1 parent 39a382d commit 6710f00

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

veadk/cli/cli_web.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import logging
1516
from functools import wraps
1617

1718
import click
@@ -139,5 +140,14 @@ async def wrapper(*args, **kwargs) -> ADKRunner:
139140
# from Google ADK and Litellm
140141
if "--log_level" not in extra_args:
141142
extra_args.extend(["--log_level", "ERROR"])
143+
logging.basicConfig(level=logging.ERROR, force=True)
144+
145+
if "--log_level" in extra_args:
146+
logging.basicConfig(
147+
level=getattr(
148+
logging, extra_args[extra_args.index("--log_level") + 1].upper()
149+
),
150+
force=True,
151+
)
142152

143153
cli_web.main(args=extra_args, standalone_mode=False)

0 commit comments

Comments
 (0)