Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/fastapi/fastapi
/ write_log
Function
write_log
docs_src/background_tasks/tutorial002_py310.py:6–8 ·
view source on GitHub ↗
(message: str)
Source
from the content-addressed store, hash-verified
4
5
6
def
write_log(message: str):
7
with
open(
"log.txt"
, mode=
"a"
)
as
log:
8
log.write(message)
9
10
11
def
get_query(background_tasks: BackgroundTasks, q: str | None = None):
Callers
nothing calls this directly
Calls
1
write
Method · 0.80
Tested by
no test coverage detected