react-native-navigation的迁移库

log.js 961B

123456789101112131415161718192021222324252627282930313233
  1. const bColors = {
  2. HEADER : '\033[95m',
  3. OKBLUE : '\033[94m',
  4. OKGREEN : '\033[92m',
  5. WARNING : '\033[93m',
  6. FAIL : '\033[91m',
  7. ENDC : '\033[0m',
  8. BOLD : '\033[1m',
  9. UNDERLINE : '\033[4m'
  10. }
  11. const log = (text) => process.stdout.write(text);
  12. const logn = (text) => process.stdout.write(text + "\n");
  13. const warn = (text) => process.stdout.write(`${bColors.WARNING}${text}${bColors.ENDC}`)
  14. const warnn = (text) => warn(text + "\n");
  15. const error = (text) => process.stdout.write(`${bColors.FAIL}${text}${bColors.ENDC}`)
  16. const errorn = (text) => error(text + "\n");
  17. const info = (text) => process.stdout.write(`${bColors.OKGREEN}${text}${bColors.ENDC}`)
  18. const infon = (text) => info(text + "\n");
  19. const debug = (text) => process.stdout.write(`${bColors.OKBLUE}${text}${bColors.ENDC}`)
  20. const debugn = (text) => debug(text + "\n");
  21. module.exports = {
  22. log,
  23. logn,
  24. warn,
  25. warnn,
  26. info,
  27. infon,
  28. debug,
  29. debugn,
  30. errorn
  31. }