fal.logging package

Submodules

fal.logging.isolate module

class fal.logging.isolate.IsolateLogPrinter(debug=False)

Bases: object

debug: bool
print(log)

fal.logging.style module

fal.logging.trace module

class fal.logging.trace.TraceContext(trace_id, span_id, invocation_id)

Bases: object

invocation_id: str
span_id: str
trace_id: str
class fal.logging.trace.TraceContextInterceptor

Bases: ClientInterceptor

intercept(method, request_or_iterator, call_details)

Override this method to implement a custom interceptor.

This method is called for all unary and streaming RPCs. The interceptor implementation should call method using a grpc.ClientCallDetails and the request_or_iterator object as parameters. The request_or_iterator parameter may be type checked to determine if this is a singluar request for unary RPCs or an iterator for client-streaming or client-server streaming RPCs.

Parameters:
  • method (Callable) – A function that proceeds with the invocation by executing the next interceptor in the chain or invoking the actual RPC on the underlying channel.

  • request_or_iterator (Any) – RPC request message or iterator of request messages for streaming requests.

  • call_details (ClientCallDetails) – Describes an RPC to be invoked.

Returns:

The type of the return should match the type of the return value received by calling method. This is an object that is both a Call for the RPC and a Future.

The actual result from the RPC can be got by calling .result() on the value returned from method.

fal.logging.trace.get_current_span_context()
Return type:

TraceContext | None

Module contents

class fal.logging.DebugConsoleLogProcessor

Bases: object

Log processor that prints to the console the well-formatted messages only when in debug mode (enabled by the –debug flag).

debug: bool = False
renderer = <structlog.dev.ConsoleRenderer object>
fal.logging.get_logger(*args, **initial_values)
Return type:

BoundLogger

fal.logging.set_debug_logging(debug)

Enable/disable console log output.