Open mdvorscak opened 6 years ago
Not sure I follow completely. .log()
is just meant as a convenient helper for writing the console.log
statement yourself. It should really throw if start
and end
were never called. If you want to log a custom metric, maybe just console.log
what you want :) ?
Yeah, of course I can write the log statement myself. I just thought it would be nicer if I could use metric.log
to remain consistent. Rather than switching between metric.log
and console.log
, if I want to keep my log messages the same it means that I must know the internals of how metric is doing it's logging (and format my console.log the same).
Maybe metric.log
really should throw an error if there is no duration associated to it?
Maybe metric.log really should throw an error if there is no duration associated to it?
Yea exactly :) That ways it's not ambiguous and you don't need to understand the internal details. I'm happy to take a PR for that btw.
In the first paint example
Of course I can manually generate the log, but it could be nice if the log could take an overridable duration parameter (like sendToAnalytics):
Or maybe a way to set the duration itself for these types of events?
What do you think?