# aego/log

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

Build messages with `+` and `string(x)`. None of the functions stops the script; `Error` is for problems the script can recover from. Debug messages are hidden in the editor's Console unless it runs with `-debug`; the Run output below shows every level.

## Example

```aes run
package demo

import "aego/log"

script Health {
    @export var Max int = 3

    var hp int
    var frames int

    func Ready() {
        hp = Max
        log.Info(node.Name() + " starts with " + string(hp) + " hp")
        log.Debug("Debug lines are hidden in the editor unless it runs with -debug")
    }

    func Update(dt float) {
        frames++
        if frames % 30 != 0 || hp == 0 {
            return
        }
        hp--
        if hp == 0 {
            log.Error("died on frame " + string(frames))
        } else if hp == 1 {
            log.Warn("one hit left")
        } else {
            log.Info("hit, " + string(hp) + " hp left")
        }
    }
}
```

## Debug

```
func Debug(msg string)
```

Writes a message to the Console. Debug messages are hidden unless the editor runs with -debug.

## Error

```
func Error(msg string)
```

Writes an error to the Console. It does not stop the script; use it for problems you can recover from.

## Info

```
func Info(msg string)
```

Writes a message to the Console.

## Warn

```
func Warn(msg string)
```

Writes a warning to the Console.
