Turn audio into a shareable video. forked from nypublicradio/audiogram

index.js 555B

123456789101112131415161718192021222324252627282930313233343536373839
  1. var winston = require("winston"),
  2. morgan = require("morgan");
  3. winston.setLevels({ error: 0, info: 1, debug: 2, web: 3 });
  4. winston.level = process.env.DEBUG ? "debug" : "info";
  5. function log(msg, level) {
  6. if (!level) {
  7. level = "info";
  8. }
  9. // TODO Add timestamp
  10. winston.log(level, msg);
  11. }
  12. function debug(msg) {
  13. log(msg, "debug");
  14. }
  15. var stream = {
  16. write: function(msg) {
  17. log(msg, "web");
  18. }
  19. };
  20. module.exports = {
  21. log: log,
  22. debug: debug,
  23. morgan: function() {
  24. return morgan("combined", { "stream": stream });
  25. }
  26. };