Skip to content

Commit e11fd83

Browse files
authored
Improve markdown code linting command and update logging documentation and (#4902)
Update logging documentation and improve markdown code linting command
1 parent d55b8c9 commit e11fd83

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

python/packages/autogen-core/docs/src/user-guide/core-user-guide/framework/logging.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,17 @@ logger = logging.getLogger(f"{TRACE_LOGGER_NAME}.my_module")
7575

7676
### Emitting structured logs
7777

78-
If your event looks like:
78+
If your event is a dataclass, then it could be emitted in code like this:
7979

8080
```python
81+
import logging
8182
from dataclasses import dataclass
83+
from autogen_core import EVENT_LOGGER_NAME
8284

8385
@dataclass
8486
class MyEvent:
8587
timestamp: str
8688
message: str
87-
```
88-
89-
Then it could be emitted in code like this:
90-
91-
```python
92-
from autogen_core import EVENT_LOGGER_NAME
9389

9490
logger = logging.getLogger(EVENT_LOGGER_NAME + ".my_module")
9591
logger.info(MyEvent("timestamp", "message"))

python/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ gen-proto = "python -m grpc_tools.protoc --python_out=./packages/autogen-ext/src
8989

9090
gen-proto-samples = "python -m grpc_tools.protoc --python_out=./packages/autogen-core/samples/protos --grpc_python_out=./packages/autogen-core/samples/protos --mypy_out=./packages/autogen-core/samples/protos --mypy_grpc_out=./packages/autogen-core/samples/protos --proto_path ../protos/ agent_events.proto"
9191

92-
markdown-code-lint = "python check_md_code_blocks.py ../README.md ./packages/autogen-core/docs/src/user-guide/agentchat-user-guide/*.md ./packages/autogen-core/docs/src/index.md"
92+
markdown-code-lint = """python check_md_code_blocks.py ../README.md ./packages/autogen-core/docs/src/**/*.md"""
9393

9494
[[tool.poe.tasks.gen-test-proto.sequence]]
9595
cmd = "python -m grpc_tools.protoc --python_out=./packages/autogen-core/tests/protos --grpc_python_out=./packages/autogen-core/tests/protos --mypy_out=./packages/autogen-core/tests/protos --mypy_grpc_out=./packages/autogen-core/tests/protos --proto_path ./packages/autogen-core/tests/protos serialization_test.proto"

0 commit comments

Comments
 (0)