tricycle/system-actor-model/4.1.1

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 453391e34e34 of https://github.com/bellroy/system-actor-model (zip prefix tricycle-system-actor-model-bfb0210/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 692f44937b7a0c5cfe82a8f7438616d19b9ee6b2.

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/4.1.1/

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 address actorName wrappedMsg =
LogMessage address actorName wrappedMsg

The opaque LogMessage type

You can create LogMessages using the helper function available

Create

emergency : PID -> String -> LogMessage address actorName wrappedMsg

Create a new LogMessage with the severity Emergency

alert : PID -> String -> LogMessage address actorName wrappedMsg

Create a new LogMessage with the severity Alert

critical : PID -> String -> LogMessage address actorName wrappedMsg

Create a new LogMessage with the severity Critical

error : PID -> String -> LogMessage address actorName wrappedMsg

Create a new LogMessage with the severity Error

warning : PID -> String -> LogMessage address actorName wrappedMsg

Create a new LogMessage with the severity Warning

notice : PID -> String -> LogMessage address actorName wrappedMsg

Create a new LogMessage with the severity Notice

info : PID -> String -> LogMessage address actorName wrappedMsg

Create a new LogMessage with the severity Informational

debug : PID -> String -> LogMessage address actorName wrappedMsg

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 address actorName wrappedMsg
-> Posix
-> LogMessage address actorName wrappedMsg

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 address actorName wrappedMsg
-> LogMessage address actorName wrappedMsg
-> LogMessage address actorName wrappedMsg

Supply a Message that resulted in this logMessage

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

Helpers

toString : LogMessage address actorName wrappedMsg -> String

Turn a LogMessage into a String

error pid wrappedMsg "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 wrappedMsg "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 address actorName appMsg
-> { posix : Maybe Posix
, severity : Severity
, pid : PID
, message : Maybe (SystemMessage address actorName appMsg)
, description : String
}

LogMessage to Description