Skip to content

Commit 74dbad0

Browse files
committed
introduce ROBOT_CALL_TRACING_ENABLED and ROBOT_CALL_TRACING_LEVEL environment variables
1 parent a32250e commit 74dbad0

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010

1111
workflow_dispatch:
1212

13+
env:
14+
ROBOT_CALL_TRACING_ENABLED: 1
15+
1316
jobs:
1417
test:
1518
runs-on: ${{ matrix.os }}
@@ -114,6 +117,7 @@ jobs:
114117
- uses: Gr1N/setup-poetry@v7
115118

116119
- run: pip install poetry-dynamic-versioning
120+
- run: pip install GitPython
117121

118122
- run: poetry install
119123

@@ -125,7 +129,7 @@ jobs:
125129
126130
- name: package
127131
run: |
128-
poetry run npm run package
132+
npm run package
129133
130134
- name: Upload VSCode package
131135
uses: actions/upload-artifact@v2

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ filterwarnings = "ignore:.*Using or importing the ABCs from 'collections' instea
117117
testpaths = ["tests"]
118118
junit_suite_name = "robotcode"
119119
log_cli = true
120-
log_cli_level = "DEBUG"
120+
log_cli_level = 4
121121
log_cli_format = "%(levelname)s %(name)s: %(message)s"
122122
asyncio_mode = "auto"
123123

robotcode/utils/logging.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import functools
55
import inspect
66
import logging
7+
import os
78
import reprlib
89
import time
910
from enum import Enum
@@ -298,8 +299,12 @@ def __repr__(self) -> str:
298299
level = logging.getLevelName(logger.getEffectiveLevel())
299300
return f"{self.__class__.__name__}(name={repr(logger.name)}, level={repr(level)})"
300301

301-
_call_tracing_enabled = False
302-
_call_tracing_default_level = TRACE
302+
_call_tracing_enabled = (
303+
"ROBOT_CALL_TRACING_ENABLED" in os.environ and os.environ["ROBOT_CALL_TRACING_ENABLED"] != "0"
304+
)
305+
_call_tracing_default_level = (
306+
os.environ["ROBOT_CALL_TRACING_LEVEL"] if "ROBOT_CALL_TRACING_LEVEL" in os.environ else TRACE
307+
)
303308

304309
@classmethod
305310
def set_call_tracing(cls, value: bool) -> None:

0 commit comments

Comments
 (0)