# `Ankusa.LogLevel`
[🔗](https://github.com/jamescarr/ankusa/blob/ankusa-v0.7.0/packages/ankusa/lib/ankusa/log_level.ex#L1)

The VM's `Logger` level, changed while the node runs.

`set/1` is what `PUT /v1/log-level` (`Ankusa.Admin.Router`, scope
`config:write`) calls, and what `ankusa_server` calls at boot with
`log.level`: one place decides which levels exist. The change is global and
immediate (`Logger.configure/1` moves the primary level), needs no restart and
is not persisted: a restarted node logs at the level its config file names.

Only `debug`, `info`, `warning` and `error` are accepted, the same set
`log.level` takes.

# `level`

```elixir
@type level() :: :debug | :info | :warning | :error
```

A level this module accepts.

# `get`

```elixir
@spec get() :: Logger.level()
```

The level now in force.

# `levels`

```elixir
@spec levels() :: [level()]
```

Every accepted level, most verbose first.

# `parse`

```elixir
@spec parse(term()) :: {:ok, level()} | :error
```

Read `level` (an atom, or its name as a string) as an accepted level.

# `set`

```elixir
@spec set(term()) :: {:ok, previous :: Logger.level()} | {:error, :invalid_level}
```

Make `level` the VM's log level. Returns the level that was in force, so the
caller can report (and audit) the change.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
