Nav apraksta

examples.js 1018B

1234567891011121314151617181920212223242526
  1. var Log = require('./').Log;
  2. function doThings(options) {
  3. console.log();
  4. console.log(options);
  5. var log = new Log(options);
  6. log.header("Header line.");
  7. log.subhead("Subhead line.");
  8. log.write("Testing").write(" 123...").writeln("done!");
  9. log.write("Verbose: ").verbose.write("YES").or.write("NO").always.write(", ");
  10. log.notverbose.write("NO").or.write("YES").always.writeln("!");
  11. log.warn("This is a warning.");
  12. log.write("Doing something...").warn();
  13. log.error("This is an error.");
  14. log.write("Doing something...").error();
  15. log.ok("This is ok.");
  16. log.write("Doing something...").ok();
  17. log.errorlns("This is a very long line in errorlns that should wrap eventually, given that it is a very long line.");
  18. log.oklns("This is a very long line in oklns that should wrap eventually, given that it is a very long line.");
  19. log.success("This is a success message.");
  20. log.fail("This is a fail message.");
  21. log.debug("This is a debug message.");
  22. }
  23. doThings({});
  24. doThings({verbose: true});