Closed salmanahmad closed 11 years ago
(Anything is better than Python's trailing comma syntax.)
We don't expect dog to be used for building console programs, so why not put the focus on "logging" from the beginning?
dog.log: "This happened"
@ef4, not a bad idea. Can we imagine a use for a standardized set of logging functions, or is this over engineering...
dog.warn: "Warning"
dog.error: "Error"
dog.log: "Message"
Easy to add those when they're needed.
As long as we're over-engineering, it would be nice if the logging function(s) could access enough of their calling context to know what module they were called from.
That way libraries can log as they want to, and the main program can configure log levels and logline formats per module.
As of now, we have dog.print, dog.println, and console.log. I think this should be sufficient for now. Thoughts?
Making
dog.print:
NOT include a newline at the end. Adding adog.println:
function to do that instead. What do we think about those names? Alternatives:dog.print_line:
dog.print_ln:
dog.puts:
Thoughts?