---
url: >-
  /statelake/scripting-reference/functions-and-procedures/logging-functions/logwarning.md
---

# LogWarning

When activated, **LogWarning** creates an entry in the action **Log** of the type **User Warning**, as illustrated in this **Log** snippet below. **LogWarning** will allow the script to continue.

The message that is produced as a result of the **LogWarning**, should be as precise as possible and provide enough information for the user to fix the problem and re-run the action.

**Declaration**: procedure LogWarning(aMesg : string);

A simple example.

```pascal
procedure OnMapEvent(var Value:Variant);
begin
 if MyData.EOF then
    LogWarning('You are at the end of records in MyData recordset');
end;
```

Please also refer to [Exception Functions](/statelake/scripting-reference/functions-and-procedures/exception-functions/) and [Try....Except](/statelake/scripting-reference/statements/try....except) for additional information regards error logging.
