> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://mmg-sdk.wetechnologygroup.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://mmg-sdk.wetechnologygroup.com/_mcp/server.

# Logging

> Monitor SDK behavior and network traffic

The SDK supports comprehensive logging. You can configure it by passing a `logging` object into the client initialization options.

```typescript
import { MMGClient, logging } from "mobile-money-sdk";

const client = new MMGClient({
    // ... credentials
    logging: {
        level: logging.LogLevel.Debug,       // Defaults to LogLevel.Info
        logger: new logging.ConsoleLogger(), // Defaults to ConsoleLogger
        silent: false,                       // Defaults to true
    }
});
```

## Configuration Options

* **`level`**: The verbosity of the logs (`logging.LogLevel.Debug`, `Info`, `Warn`, or `Error`).
* **`logger`**: The logging implementation to use.
* **`silent`**: Set to `false` to enable output.

## Custom Loggers

To provide a custom logger, pass in an object that implements the `logging.ILogger` interface.

<details>
  <summary>
    Example: Using Winston
  </summary>

  ```typescript
  import winston from 'winston';
  import { logging } from 'mobile-money-sdk';

  const winstonLogger = winston.createLogger({ /* ... config ... */ });

  const logger: logging.ILogger = {
      debug: (msg, ...args) => winstonLogger.debug(msg, ...args),
      info: (msg, ...args) => winstonLogger.info(msg, ...args),
      warn: (msg, ...args) => winstonLogger.warn(msg, ...args),
      error: (msg, ...args) => winstonLogger.error(msg, ...args),
  };
  ```
</details>

<details>
  <summary>
    Example: Using Pino
  </summary>

  ```typescript
  import pino from 'pino';
  import { logging } from 'mobile-money-sdk';

  const pinoLogger = pino({ /* ... config ... */ });

  const logger: logging.ILogger = {
    debug: (msg, ...args) => pinoLogger.debug(args, msg),
    info: (msg, ...args) => pinoLogger.info(args, msg),
    warn: (msg, ...args) => pinoLogger.warn(args, msg),
    error: (msg, ...args) => pinoLogger.error(args, msg),
  };
  ```
</details>