MCPcopy Create free account
hub / github.com/anomalyco/opencode-sdk-python / log

Method log

src/opencode_ai/resources/app.py:89–138  ·  view source on GitHub ↗

Write a log entry to the server logs Args: level: Log level message: Log message service: Service name for the log entry extra: Additional metadata for the log entry extra_headers: Send extra headers extra_query: Add

(
        self,
        *,
        level: Literal["debug", "info", "error", "warn"],
        message: str,
        service: str,
        extra: Dict[str, object] | NotGiven = NOT_GIVEN,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
    )

Source from the content-addressed store, hash-verified

87 )
88
89 def log(
90 self,
91 *,
92 level: Literal["debug", "info", "error", "warn"],
93 message: str,
94 service: str,
95 extra: Dict[str, object] | NotGiven = NOT_GIVEN,
96 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
97 # The extra values given here take precedence over values defined on the client or passed to this method.
98 extra_headers: Headers | None = None,
99 extra_query: Query | None = None,
100 extra_body: Body | None = None,
101 timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
102 ) -> AppLogResponse:
103 """
104 Write a log entry to the server logs
105
106 Args:
107 level: Log level
108
109 message: Log message
110
111 service: Service name for the log entry
112
113 extra: Additional metadata for the log entry
114
115 extra_headers: Send extra headers
116
117 extra_query: Add additional query parameters to the request
118
119 extra_body: Add additional JSON properties to the request
120
121 timeout: Override the client-level default timeout for this request, in seconds
122 """
123 return self._post(
124 "/log",
125 body=maybe_transform(
126 {
127 "level": level,
128 "message": message,
129 "service": service,
130 "extra": extra,
131 },
132 app_log_params.AppLogParams,
133 ),
134 options=make_request_options(
135 extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
136 ),
137 cast_to=AppLogResponse,
138 )
139
140 def modes(
141 self,

Calls 2

maybe_transformFunction · 0.85
make_request_optionsFunction · 0.85