basic.cjs 862 B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. const core = require('./core.cjs');
  4. const basic = require('./shared/consola.deac7d5a.cjs');
  5. require('node:util');
  6. require('node:path');
  7. function createConsola(options = {}) {
  8. let level = core.LogLevels.info;
  9. if (process.env.CONSOLA_LEVEL) {
  10. level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
  11. }
  12. const consola2 = core.createConsola({
  13. level,
  14. defaults: { level },
  15. stdout: process.stdout,
  16. stderr: process.stderr,
  17. reporters: options.reporters || [new basic.BasicReporter()],
  18. ...options
  19. });
  20. return consola2;
  21. }
  22. const consola = createConsola();
  23. exports.Consola = core.Consola;
  24. exports.LogLevels = core.LogLevels;
  25. exports.LogTypes = core.LogTypes;
  26. exports.consola = consola;
  27. exports.createConsola = createConsola;
  28. exports.default = consola;