8000 fix: avoid duplicating log in stderr. · calvingiles/adk-python@16d9696 · GitHub
[go: up one dir, main page]

Skip to content

Commit 16d9696

Browse files
Jacksunweicopybara-github
authored andcommitted
fix: avoid duplicating log in stderr.
This was introduced to work around google-auth kills all logs via `google` root logging namespace. Given we're now using `google_adk` as root logging namesapce, we don't need additional Stream log handler now. PiperOrigin-RevId: 763924531
1 parent 03fe909 commit 16d9696

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/google/adk/cli/utils/logs.py

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

15+
from __future__ import annotations
16+
1517
import logging
1618
import os
17-
import sys
1819
import tempfile
1920
import time
2021

@@ -27,14 +28,8 @@ def setup_adk_logger(level=logging.INFO):
2728
# Configure the root logger format and level.
2829
logging.basicConfig(level=level, format=LOGGING_FORMAT)
2930

30-
# Set up adk_logger and log to stderr.
31-
handler = logging.StreamHandler(sys.stderr)
32-
handler.setLevel(level)
33-
handler.setFormatter(logging.Formatter(LOGGING_FORMAT))
34-
3531
adk_logger = logging.getLogger('google_adk')
3632
adk_logger.setLevel(level)
37-
adk_logger.addHandler(handler)
3833

3934

4035
def log_to_tmp_folder(

0 commit comments

Comments
 (0)
0