Introduce different log levels

This commit is contained in:
Michael Jackson
2018-08-25 23:49:44 -07:00
parent fe4ccec4e2
commit 82d404a973
4 changed files with 36 additions and 9 deletions

View File

@ -5,13 +5,16 @@ const tar = require("tar-stream");
const bufferStream = require("./bufferStream");
const agent = require("./registryAgent");
const logging = require("./logging");
function fetchNpmPackage(packageConfig) {
return new Promise((resolve, reject) => {
const tarballURL = packageConfig.dist.tarball;
console.log(
`info: Fetching package for ${packageConfig.name} from ${tarballURL}`
logging.debug(
"Fetching package for %s from %s",
packageConfig.name,
tarballURL
);
const { hostname, pathname } = url.parse(tarballURL);