import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'

The **GW2RegisterReportFile** function registers the file path where the engineering log file is to be placed. This API generates the report file **only for debug builds of the Glasswall Engine.**

<Tabs>

<TabItem value="C++" label="C++" default>

**Synopsis**

For session **session**, the **GW2RegisterReportFile** function registers the name of the file where the engineering log file is to be placed. The name is the string pointed to by **reportFilePathName**.

```cpp
#include "glasswall.core2.api.h"
int GW2RegisterReportFile(Session session, const char *reportFilePathName);
```

**Returns**

Returns an integer `GW2_RetStatus` enum value. Negative numbers indicate a failure.

</TabItem>

<TabItem value="C#" label="C#">

**Synopsis**

```csharp
public int RegisterReportFile(
    int session,
    string reportFilePathName)

```

**Returns**

Returns an integer `GW2_RetStatus` enum value. Negative numbers indicate a failure.

</TabItem>

<TabItem value="Java" label="Java">

**Synopsis**

```java
import com.glasswall.core2javabridge.*;

public int GW2RegisterReportFile(int session, String reportFilePath) throws GlasswallException, NullPointerException

(Deprecated)
public int GW2RegisterReportFile(int session, byte[] reportFilePath) throws GlasswallException, NullPointerException
```

**Description**

The **GW2RegisterReportFile** function parameters have been updated to use `String` in place of `byte[]`. The original function has been deprecated.

**Returns**

The **GW2RegisterReportFile** function returns a **GW2_RetStatus** enumeration converted to `int`. The value will be negative if an error occurred. `0` indicates success. Refer to the API Overview/Return types for details. 

A **NullPointerException** exception will be thrown if `reportFilePath` is null or empty.

A **GlasswallException** exception will be thrown if `session` is invalid, if the `reportFilePath` could not be retrieved, or if the `reportFilePath` could not be converted to UTF-8.

</TabItem>

<TabItem value="Python" label="Python">

**Synopsis**

Registers the name of the file where the engineering log file is to be placed.

```py
def register_report_file(self, session: int, output_file: str):
    """ Register the report file path for the given session.

    Args:
        session (int): The session integer.
        output_file (str): The file path of the report file.

    Returns:
        gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attributes 'session', 'output_file', 'status'.
    """
```

**Returns**

gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attributes 'session', 'output_file', 'status'.

</TabItem>

<TabItem value="JavaScript" label="JavaScript">

**Synopsis**

This function registers the name of the file where the engineering log file is to be placed.

```jsx

/**
* @param {number} session The ID of the session.
* @param {string} reportFilePathName The path of the file to be registered.
*/

GW2RegisterReportFile(session, reportFilePathName)

```

**Returns**

Returns an integer `GW2_RetStatus` enum value. Negative numbers indicate a failure.

</TabItem>

</Tabs>