I am finding it useful to know which Msgs are being triggered through my 
update functions, so have been putting in code like this:

log =
    Debug.log "myModule"


        Add ->
            let d = log "add" in

Now I have decided it would be easier to just print all Msgs rather than 
add this to specific ones:

debug : a -> a
debug a =
    Debug.log "myModule" a

update : Msg -> Model -> ( Model, Cmd Msg )
update action model =
    update' (debug action) model
-- OR even     update' (debug action) (debug model)

update' : Msg -> Model -> ( Model, Cmd Msg )

And am considering pulling up the 'debug' function into its own module, so 
I can easily globally turn on/off debug tracing by switching it between the 
identity function or the logging function.

Just wondering if anyone has any helpfull debugging tricks they like to use 
with Elm?

You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to