getTimestamps
Get the current global timestamp setting.
Syntax​
getTimestamps(): boolean
Returns​
trueif timestamps are enabledfalseif timestamps are disabled
Examples​
Basic Usage​
const logger = InteractiveLogger();
const timestampsEnabled = logger.getTimestamps();
console.log('Timestamps enabled:', timestampsEnabled);
Conditional Logic​
const logger = InteractiveLogger();
if (!logger.getTimestamps()) {
logger.setTimestamps(true);
console.log('Timestamps enabled');
}
See Also​
- setTimestamps - Set timestamp setting
- LoggerInstance.setTimestamps - Set timestamps for a specific instance