# Logging

Vibora has a simple logging mechanism to avoid locking you into our library of choice.

You must provide a function that receives two parameters: a msg and a logging level (that matches logging standard library for usability sake).

That's all.

It's up to you to choose what to do with logging messages.

```python
import logging
from vibora import Vibora, Response

app = Vibora()

@app.route('/')
def home():
    return Response(b'Hello World')

if __name__ == '__main__':
    def log_handler(msg, level):
        # Redirecting the msg and level to logging library.
        getattr(logging, level)(msg)
        print(f'Msg: {msg} / Level: {level}')

    app.run(logging=log_handler)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vibora.io/v0.1.0/logging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
