Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upexpose more debugging features, like console.group #633
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
noahzgordon
Jun 6, 2016
Contributor
Right now it looks like the Debug.log function simply calls toString on the second argument (the value being logged) and appends it to the first argument. Would it be reasonable to log the value directly instead?
var msg = tag + ': ' + _elm_lang$core$Native_Utils.toString(value);
...
console.log(msg);
becomes...
console.log(tag, value);
|
Right now it looks like the
becomes...
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Fresheyeball
Jun 6, 2016
There is kind of a lot that could be done here. I ended having to write this as a band-aid. https://gist.github.com/Fresheyeball/94e25fcefc517a74382e55283eec9093
But I wouldn't consider it a solution. I'm starting to think Elm should just expose (almost) the entirety of this: https://developer.chrome.com/devtools/docs/console-api .
And in two styles (we might want logging for things other than debugging).
Console.log : String -> Task Never ()
and for debugging in a raw way
Debug.log : String -> a -> a
This way it would be possible for Elm library authors to put together their own debugging packages.
Fresheyeball
commented
Jun 6, 2016
•
|
There is kind of a lot that could be done here. I ended having to write this as a band-aid. https://gist.github.com/Fresheyeball/94e25fcefc517a74382e55283eec9093 But I wouldn't consider it a solution. I'm starting to think Elm should just expose (almost) the entirety of this: https://developer.chrome.com/devtools/docs/console-api . And in two styles (we might want logging for things other than debugging).
and for debugging in a raw way
This way it would be possible for Elm library authors to put together their own debugging packages. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
noahzgordon
Jun 6, 2016
Contributor
Sounds like a cool idea! Perhaps we could start working on an elm-debug-extra or elm-developer-console library in order to expose more of the Console API?
|
Sounds like a cool idea! Perhaps we could start working on an |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Fresheyeball
Jun 6, 2016
No go. Elm rejects anything native. It needs to be owned by elm-lang.
I'd be happy to take this on, but @evancz would need to bless me for the
task.
On Mon, Jun 6, 2016 at 9:15 AM Noah Zachary Gordon notifications@github.com
wrote:
Sounds like a cool idea! Perhaps we could start working on an
elm-debug-extra or elm-developer-console library in order to expose more
of the Console API?—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/elm-lang/core/issues/633#issuecomment-223990254, or mute
the thread
https://github.com/notifications/unsubscribe/AAlL_ws6r-u2VcuQY70QX4BX75TNsim7ks5qJDmugaJpZM4IqDN_
.
Fresheyeball
commented
Jun 6, 2016
|
No go. Elm rejects anything native. It needs to be owned by elm-lang. I'd be happy to take this on, but @evancz would need to bless me for the
|
Fresheyeball commentedMay 30, 2016
As it stands
Debug.logis the only thing provided for instrumenting and debugging code in Elm, and it's not usable for all cases.For example, there might be a deeply nested structure represented by the top level
Modelof the application. WithDebug.logwe are given an un-usable display of this complex structure as a single string without even basic indentation.Instead lets make this kick ass. With something much more similar to the experience of logging a native javascript object to the console; where nested structures can be collapsed or expanded.
I believe this can be accomplished using
console.group, or some similar technique.