# Logging

## Logger Class

The `Logger` class is designed to facilitate logging within your application. It provides various log levels to categorize and differentiate the type and severity of log messages.&#x20;

You can use this class to record important information, debug messages, warnings, and errors during the execution of your application.

### Methods

#### `info(format: String, ...args?: any[]): void`

Use this method to log informational messages. It accepts a format string and optional additional arguments that can be interpolated into the format string.&#x20;

These messages are typically used to convey important details about the application's operation.

```typescript
// Log informational message
Logger.info("This is an informational message.");
```

#### `debug(format: String, ...args?: any[]): void`

The `debug` method is intended for logging debugging messages. Like `info`, it also accepts a format string and optional arguments.&#x20;

Debugging messages help developers understand the inner workings of the application and troubleshoot issues during development and testing.

```typescript
// Log debugging message with interpolated argument
var variable = 42;
Logger.debug("Debugging message: %s", variable);
```

#### `warn(format: String, ...args?: any[]): void`

To log warning messages, use the `warn` method. It accepts a format string and optional arguments.&#x20;

Warning messages are crucial for notifying users or developers about potential issues that do not disrupt the application's flow but should be addressed.

```typescript
// Log a warning message
Logger.warn("Warning: Something might be wrong.");
```

#### `error(format: String, ...args?: any[]): void`

The `error` method is designed to log error messages. It accepts a format string and optional arguments.&#x20;

Error messages are essential for identifying critical issues that need immediate attention and resolution. They help pinpoint problems in the application.

```typescript
// Log an error message
Logger.error("Error: Something went terribly wrong.");
```
