Listen for syslogs. Minimal example:
import EnTrance.Channel as Channel
import EnTrance.Feature.Router.Syslog as Syslog
import EnTrance.Types exposing (MaybeSubscribe(..))
Syslog.start IgnoreConState [] []
|> Channel.send model
Target.connect params
|> Channel.send modelOnce the connection is up, you will received a notification of type "syslog", that can be decoded using decode into a Syslog type.
If you want to turn on one or more debugs, you can do that:
debugs = ["debug sysdb access", "debug sysdb verification"]
Syslog.start IgnoreConState debugs []
|> Channel.send modelIf you want to filter syslogs, you can provide a list of matching strings (in fact Python regular expressions). If this is non-empty, then only syslogs matching at least one filter will be sent.
-- Just tell me about commits
filters = ["%MGBL-CONFIG-6-DB_COMMIT"]
Syslog.start IgnoreConState [] filters
|> Channel.send modelAnd you can combine both debugs and filters:
debugs = ["debug sysdb access", "debug sysdb verification"]
filters = ["sysdb"]
Syslog.start IgnoreConState debug filters
|> Channel.send modelA received syslog: a message and a timestamp.
Decode a syslog notification into a Syslog. Takes a message constructor.
Decode an up/down notification requested by passing SubscribeToConState to start. Takes a message constructor.
Start listening for syslogs on a single target. This is an async request - use the connection state notifications to track progress.