Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

options.js 744B

12345678910111213141516171819202122232425262728293031
  1. // eslint-disable-next-line import/no-extraneous-dependencies
  2. const log = require('loglevel');
  3. const prefix = require('../lib/loglevel-plugin-prefix');
  4. prefix.reg(log);
  5. log.enableAll();
  6. prefix.apply(log, {
  7. template: '[%t] %l (%n) static text:',
  8. timestampFormatter(date) {
  9. return date.toISOString();
  10. },
  11. levelFormatter(level) {
  12. return level.toUpperCase();
  13. },
  14. nameFormatter(name) {
  15. return name || 'global';
  16. },
  17. });
  18. log.info('%s prefix', 'template');
  19. const fn = (level, name, timestamp) => `[${timestamp}] ${level} (${name}) static text:`;
  20. prefix.apply(log, { format: fn });
  21. log.info('%s prefix', 'functional');
  22. prefix.apply(log, { template: '[%t] %l (%n) static text:' });
  23. log.info('again %s prefix', 'template');