# output



# print_stdout

**Descripción**

Imprime el mensaje en stdout

**Parámetros**

<table border="1" id="bkmrk-module-acepta-el-tip"><tbody><tr><td>**Nombre** </td><td>**Tipo**</td><td>**Requerido**</td><td>**Descripción**</td></tr><tr><td>message</td><td>str</td><td>No</td><td>Mensaje a imprimir. Por defecto es ""</td></tr></tbody></table>

**Return**

<table border="1" id="bkmrk-tipo-none" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 100%;">**Tipo**</td></tr><tr><td style="width: 100%;">None</td></tr></tbody></table>

**Versión**

- 1.0.0

**Ejemplo**

```
import pandoraPlugintools as pt

# Message to be printed
message = "Disk usage exceeded threshold: 90%."

# Print the message using the print_stdout function
pt.print_stdout(message)
```

# print_stderr

**Descripción**

Imprime el mensaje en stdout

**Parámetros**

<table border="1" id="bkmrk-module-acepta-el-tip"><tbody><tr><td>**Nombre** </td><td>**Tipo**</td><td>**Requerido**</td><td>**Descripción**</td></tr><tr><td>message</td><td>str</td><td>No</td><td>Mensaje a imprimir. Por defecto es ""</td></tr></tbody></table>

**Return**

<table border="1" id="bkmrk-tipo-none" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 100%;">**Tipo**</td></tr><tr><td style="width: 100%;">None</td></tr></tbody></table>

**Versión**

- 1.0.0

**Ejemplo**

```
import pandoraPlugintools as pt

# Monitoring error message to be printed
monitoring_error = "Error: Disk space running low!"

# Print the monitoring error message using the print_stderr function
pt.print_stderr(monitoring_error)
```

# print_debug

**Descripción**

Imprime cualquier lista, dict, string, float o integer como un json

**Parámetros**

<table border="1" id="bkmrk-module-acepta-el-tip"><tbody><tr><td>**Nombre** </td><td>**Tipo**</td><td>**Requerido**</td><td>**Descripción**</td></tr><tr><td><div><div>var</div></div></td><td>str</td><td>Si</td><td>Variable a imprimir</td></tr><tr><td><div><div>print_errors</div></div></td><td>bool</td><td>No</td><td>Imprime o no los errores. Por defecto es False.</td></tr></tbody></table>

**Return**

<table border="1" id="bkmrk-tipo-none" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 100%;">**Tipo**</td></tr><tr><td style="width: 100%;">None</td></tr></tbody></table>

**Versión**

- 1.0.0

**Ejemplo**

```
import pandoraPlugintools as pt

# Monitoring data in dictionary format
monitoring_data = {
    "disk_usage": {
        "drive": "/dev/sda1",
        "usage": "85%"
    },
    "cpu_usage": {
        "core_1": "50%",
        "core_2": "45%"
    }
}

# Print the monitoring data using the print_debug function
pt.print_debug(monitoring_data)
```

# logger

**Descripción**

Añadir una nueva línea al archivo de registro

**Parámetros**

<table border="1" id="bkmrk-module-acepta-el-tip" style="height: 174px; width: 778px;"><tbody><tr style="height: 29px;"><td style="height: 29px; width: 91px;">**Nombre** </td><td style="height: 29px; width: 45px;">**Tipo**</td><td style="height: 29px; width: 83px;">**Requerido**</td><td style="height: 29px; width: 559px;">**Descripción**</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 91px;"><div><div>log_file</div></div></td><td style="height: 29px; width: 45px;">str</td><td style="height: 29px; width: 83px;">Si</td><td style="height: 29px; width: 559px;">Ruta al archivo de registro</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 91px;">message</td><td style="height: 29px; width: 45px;">str</td><td style="height: 29px; width: 83px;">Si</td><td style="height: 29px; width: 559px;">Mensaje a añadir al registro</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 91px;"><div><div>log_level</div></div></td><td style="height: 29px; width: 45px;">str</td><td style="height: 29px; width: 83px;">No</td><td style="height: 29px; width: 559px;">Nivel de registro, si procede. Por defecto es una cadena vacía</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 91px;">add\_date</td><td style="height: 29px; width: 45px;">bool</td><td style="height: 29px; width: 83px;">No</td><td style="height: 29px; width: 559px;">Si desea añadir la fecha y hora actuales a la entrada del registro. Por defecto es True</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 91px;"><div><div>print_errors</div></div></td><td style="height: 29px; width: 45px;">bool</td><td style="height: 29px; width: 83px;">No</td><td style="height: 29px; width: 559px;">Si se imprimen los errores. Por defecto es False</td></tr></tbody></table>

**Return**

<table border="1" id="bkmrk-tipo-descripci%C3%B3n-boo" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 50%;">**Tipo**</td><td style="width: 50%;">**Descripción**</td></tr><tr><td style="width: 50%;">bool</td><td style="width: 50%;">True si la entrada de registro se ha añadido correctamente, False en caso contrario</td></tr></tbody></table>

**Versión**

- 1.0.0

**Ejemplo**

```
import pandoraPlugintools as pt

# Path to the log file
log_file = "/tmp/log_file.txt"

# Log message to be added
log_message = "Disk space usage exceeded threshold."

# Log level (optional)
log_level = "WARNING"

# Add the log entry using the logger function
pt.logger(log_file, log_message, log_level)
```