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

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/9.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 addresses actors appMsg =
LogMessage addresses actors appMsg

The opaque LogMessage type

You can create LogMessages using the helper function available

Create

emergency : PID -> String -> LogMessage addresses actors appMsg

Create a new LogMessage with the severity Emergency

alert : PID -> String -> LogMessage addresses actors appMsg

Create a new LogMessage with the severity Alert

critical : PID -> String -> LogMessage addresses actors appMsg

Create a new LogMessage with the severity Critical

error : PID -> String -> LogMessage addresses actors appMsg

Create a new LogMessage with the severity Error

warning : PID -> String -> LogMessage addresses actors appMsg

Create a new LogMessage with the severity Warning

notice : PID -> String -> LogMessage addresses actors appMsg

Create a new LogMessage with the severity Notice

info : PID -> String -> LogMessage addresses actors appMsg

Create a new LogMessage with the severity Informational

debug : PID -> String -> LogMessage addresses actors appMsg

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 addresses actors appMsg
-> Posix
-> LogMessage addresses actors appMsg

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 addresses actors appMsg
-> LogMessage addresses actors appMsg
-> LogMessage addresses actors appMsg

Supply a Message that resulted in this logMessage

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

Helpers

toString : LogMessage addresses actors appMsg -> String

Turn a LogMessage into a String

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

LogMessage to Description