You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
As of right now, there is no way to change the text used when a timer is started or ended. It's hard-coded in.
Describe the solution you'd like
It would be awesome if we could specify custom text and colors for this instead! For example:
constlog=newSignale({timers: {start: {// similar to types, just without a labelbadge: '👌',color: 'green',text: 'Custom timer started...'},end: {badge: '👍',color: 'red',text: ['Timer with custom text ran for:','and also has text here'],time: 'red'// color for time value}}});log.time('example');setTimeout(()=>{log.timeEnd('example')},1000);// 👌 example Custom timer started...// 👍 example Timer with custom text ran for: 1s and also has text here
We could also use options on specific timers.
signale.time(label, options)
log.time('another example',{start: {color: 'cyan','badge': '!'},end: {text: 'woah custom text and this timer ran for'}});setTimeout(()=>{log.timeEnd('another example')},1000);// ! another example Custom timer started...// 👍 another example woah custom text and this timer ran for 1s
Additional context
The text option could either take a single string (putting the time after it), or an array of two strings (putting the time between them).
Also, to avoid having to type out a whole configuration, another option could possibly be to simply grab an existing one. To have a timer's start log behave as if it was logged with signale.star(), you could maybe do the following. This isn't a necessary function but it could be useful to some people.
signale.time('label',{start: {type: signale.star}});// or perhaps just the string "star"
And if for whatever reason someone wanted the same configuration for both start and end without having two copies of it, these could be possible ways to implement that.
// put options in "both"signale.time('label',{both: {color: 'red'}});// OR just bring options outsidesignale.time('label',{color: 'red'});// however this works, start and end can still be specified to override thingssignale.time('label',{color: 'red',start: {color: 'green'}});// starts with green, ends with red
Of course, all of this would be optional in a configuration, since there's already a default for how timers should display.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
As of right now, there is no way to change the text used when a timer is started or ended. It's hard-coded in.
Describe the solution you'd like
It would be awesome if we could specify custom text and colors for this instead! For example:
We could also use options on specific timers.
signale.time(label, options)
Additional context
The text option could either take a single string (putting the time after it), or an array of two strings (putting the time between them).
Also, to avoid having to type out a whole configuration, another option could possibly be to simply grab an existing one. To have a timer's start log behave as if it was logged with
signale.star()
, you could maybe do the following. This isn't a necessary function but it could be useful to some people.And if for whatever reason someone wanted the same configuration for both
start
andend
without having two copies of it, these could be possible ways to implement that.Of course, all of this would be optional in a configuration, since there's already a default for how timers should display.
The text was updated successfully, but these errors were encountered: