Log
log [text]Also searchable as: Log · print · echo · output · debug · trace · write line
log writes a line of text for whoever is running the script. In the editor it appears in the Output
panel, with the time. Under EUOCli run it is printed as the script goes.
It is the way to see what a script is doing while it runs:
displaystops the script until you click, so it can’t go in a loop.event sysmessageneeds a client, and the line scrolls away in the game.lognever waits, needs no client, and the lines stay in the panel.
set %sum 0for %i 1 5{ set %sum %sum + %i log After %i the sum is %sum}log Done.haltThe Output panel then shows:
14:03:09 After 1 the sum is 114:03:09 After 2 the sum is 314:03:09 After 3 the sum is 614:03:09 After 4 the sum is 1014:03:09 After 5 the sum is 1514:03:09 Done.Parameters
Section titled “Parameters”| Parameter | Meaning |
|---|---|
text |
Optional. Everything after log, with variables replaced by their values and the words joined by single spaces. Without it, an empty line. |
Details
Section titled “Details”- The text is not changed. A
$stays a$(indisplayit starts a new line), so you can log#Propertyor a journal line exactly as the script reads it. - Words are joined by one space. Several spaces in a row become one. Glue words with
,as anywhere else:log Position: , #CharPosX , / , #CharPosY. - It sets no variable and changes nothing a script can read.
- A sub or label called
logkeeps working:gosub logandgoto logare not this command.
The Output panel
Section titled “The Output panel”The panel opens by itself, under the script, when a script logs its first line. Control → Show Output shows or hides it, and Control → Clear Output empties it.
- There is one panel for all tabs. When more than one tab is open, each line also names its tab.
- When the call stack is shown too (Control → Show Call Stack), the Output panel is to its right.
- It keeps the newest 5000 lines.
- Select text in it and press Ctrl+C to copy.
Logging while you debug
Section titled “Logging while you debug”finditem POF G_3log finditem found #FindCnt stacks, the first is #FindIDif #FindCnt > 0{ event Property #FindID log Its tooltip: #Property}haltReforged notes
Section titled “Reforged notes”log is new in EasyUO Reforged. No existing command changes because of it. It’s the only change for old
scripts: a line starting with the word log used to be ignored and is now this command.
uo.dll has no equivalent: a program using it writes its own output.