> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# log

***

# Function: log()

```ts theme={null}
function log<T, R>(
  options: LogOptions,
  fn: (...args: T) => Promise<R>,
): (...args: T) => Promise<R>;
```

Defined in: [src/wrappers.ts](https://github.com/rungalileo/galileo-js/blob/main/src/wrappers.ts)

Wraps a function to log its execution as a span in Galileo.

## Type Parameters

### T

`T` *extends* `unknown`\[]

### R

`R`

## Parameters

### options

`LogOptions`

### fn

(...`args`: `T`) => `Promise`\<`R`>

## Returns

```ts theme={null}
(...args: T): Promise<R>;
```

### Parameters

#### args

...`T`

### Returns

`Promise`\<`R`>
