Skip to content

Commit da9e5d3

Browse files
authored
refactor: [3.2.2] separate out logger functionality from nodeUtil (#405)
1 parent b03348e commit da9e5d3

File tree

13 files changed

+535
-486
lines changed

13 files changed

+535
-486
lines changed

base/shared/util.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,20 +1261,23 @@ function loadJpegStream(id, imageUrl, objs) {
12611261
img.src = "data:image/jpeg;base64," + img.btoa(imageUrl);
12621262
}
12631263

1264-
//MQZ Oct.18.2013 expose util methods
1265-
nodeUtil.p2jlog = log;
1266-
nodeUtil.p2jinfo = info;
1267-
nodeUtil.p2jwarn = warn;
1268-
nodeUtil.p2jerror = error;
1269-
nodeUtil.verbosity = function (verbo) {
1264+
// MQZ Sep.14.2025 expose util methods without coupling to node:util
1265+
PDFJS.log = log;
1266+
PDFJS.info = info;
1267+
PDFJS.warn = warn;
1268+
PDFJS.error = error;
1269+
PDFJS.verbosity = function (verbo) {
12701270
if (isNaN(verbo)) {
12711271
verbosity = WARNINGS;
12721272
} else {
12731273
if (verbo <= ERRORS) {
12741274
verbosity = ERRORS;
12751275
} else if (verbo >= INFOS) {
12761276
verbosity = INFOS;
1277-
} else verbosity = verbo;
1277+
} else {
1278+
verbosity = verbo;
1279+
}
12781280
}
12791281
};
1280-
nodeUtil.verbosity();
1282+
// Initialize default verbosity level
1283+
PDFJS.verbosity();

0 commit comments

Comments
 (0)