mirror of
https://github.com/microsoft/autogen.git
synced 2025-12-12 23:41:28 +00:00
Improve markdown code linting command and update logging documentation and (#4902)
Update logging documentation and improve markdown code linting command
This commit is contained in:
parent
d55b8c9044
commit
e11fd8353d
@ -75,21 +75,17 @@ logger = logging.getLogger(f"{TRACE_LOGGER_NAME}.my_module")
|
||||
|
||||
### Emitting structured logs
|
||||
|
||||
If your event looks like:
|
||||
If your event is a dataclass, then it could be emitted in code like this:
|
||||
|
||||
```python
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
from autogen_core import EVENT_LOGGER_NAME
|
||||
|
||||
@dataclass
|
||||
class MyEvent:
|
||||
timestamp: str
|
||||
message: str
|
||||
```
|
||||
|
||||
Then it could be emitted in code like this:
|
||||
|
||||
```python
|
||||
from autogen_core import EVENT_LOGGER_NAME
|
||||
|
||||
logger = logging.getLogger(EVENT_LOGGER_NAME + ".my_module")
|
||||
logger.info(MyEvent("timestamp", "message"))
|
||||
|
||||
@ -89,7 +89,7 @@ gen-proto = "python -m grpc_tools.protoc --python_out=./packages/autogen-ext/src
|
||||
|
||||
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"
|
||||
|
||||
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"
|
||||
markdown-code-lint = """python check_md_code_blocks.py ../README.md ./packages/autogen-core/docs/src/**/*.md"""
|
||||
|
||||
[[tool.poe.tasks.gen-test-proto.sequence]]
|
||||
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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user