# Usage

## 🪧Usage

Use following export to add log from any script

<pre><code><strong>exports['sb-logger']:createLog("category", "your log message")
</strong></code></pre>

### OxLib Usage

if you want to catch lib.logger logs autometically then modify your ox\_lib\imports\logger\server.lua in ox\_lib

1. Add new service

```
if service == 'sblogger' then
    function lib.logger(source, event, message, ...)
        exports['sb-logger']:createLog(event, message) 
    end
end
```

2. And add server.cfg

```
set ox:logger "sblogger"
```


---

# 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.suryabhai.in/sb-scripts/sb-logger/usage.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.
