tricycle/system-actor-model/7.0.0

NOTE: the latest version is 9.0.0

Renamed to bellroy/system-actor-model. That is where the repository lives now. It has not been published as a package under the new name.

Versions published as tricycle/system-actor-model still install under that name. 26 versions of 26 come from the new location (see their notes).

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/bellroy/system-actor-model.

What we checked: The repo moved to github.com/bellroy/system-actor-model. Rebuilt with git archive from commit d082a6a7e983 of https://github.com/bellroy/system-actor-model (zip prefix tricycle-system-actor-model-168feca/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 9d5fe6d8f13e10163b9e89cb893d5415adb7bed1.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/tricycle/system-actor-model/zipball/7.0.0/

System.Log

The System and your Actors can LogMessage through this module.

The System itself doesn't store these log messages anywhere, It's up to you to handle and/or store these messages through an Actor.

type alias LogMessage applicationAddress applicationActorName applicationMessage =
LogMessage
applicationAddress
applicationActorName
applicationMessage

The opaque LogMessage type

You can create LogMessages using the helper function available

Create

PID
-> String
-> LogMessage
applicationAddress
applicationActorName
applicationMessage

Create a new LogMessage with the severity Emergency

PID
-> String
-> LogMessage
applicationAddress
applicationActorName
applicationMessage

Create a new LogMessage with the severity Alert

PID
-> String
-> LogMessage
applicationAddress
applicationActorName
applicationMessage

Create a new LogMessage with the severity Critical

PID
-> String
-> LogMessage
applicationAddress
applicationActorName
applicationMessage

Create a new LogMessage with the severity Error

PID
-> String
-> LogMessage
applicationAddress
applicationActorName
applicationMessage

Create a new LogMessage with the severity Warning

PID
-> String
-> LogMessage
applicationAddress
applicationActorName
applicationMessage

Create a new LogMessage with the severity Notice

PID
-> String
-> LogMessage
applicationAddress
applicationActorName
applicationMessage

Create a new LogMessage with the severity Informational

PID
-> String
-> LogMessage
applicationAddress
applicationActorName
applicationMessage

Create a new LogMessage with the severity Debug

Time

When you create a log message through any of the create helpers your log message will not have a time accociated with it.

LogMessage
applicationAddress
applicationActorName
applicationMessage
-> Posix
-> LogMessage
applicationAddress
applicationActorName
applicationMessage

Add a Posix (elm/time) to your LogMessage

Msg

What was the message that resulted in this LogMessage? I don't know, but if you supply it I'll store it on the LogMessage type!

SystemMessage
applicationAddress
applicationActorName
applicationMessage
-> LogMessage
applicationAddress
applicationActorName
applicationMessage
-> LogMessage
applicationAddress
applicationActorName
applicationMessage

Supply a Message that resulted in this logMessage

You could use this to retry a failed command for instance.

Helpers

LogMessage
applicationAddress
applicationActorName
applicationMessage
-> String

Turn a LogMessage into a String

error pid applicationMessage "I'm sorry Dave, I'm afraid I can't do that"
    |> toString


-- error | 2(1) | I'm sorry Dave, I'm afraid I can't do that


error system applicationMessage "I'm sorry Dave, I'm afraid I can't do that"
    |> withPosix now
    |> toString


-- 2019/12/25 12:59:59 (UTC) | error | system | I'm sorry Dave, I'm afraid I can't do that
severityToString : Severity -> String

Severity to String

LogMessage
applicationAddress
applicationActorName
applicationMessage
-> { posix : Maybe Posix
, severity : Severity
, pid : PID
, message :
Maybe
(SystemMessage
applicationAddress
applicationActorName
applicationMessage
)
, description : String
}

LogMessage to Description