Skip to content

Commit b3ecf67

Browse files
committed
docs(changeset): Enhance logging
1 parent 86b75ba commit b3ecf67

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.changeset/metal-nights-hide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"git-json-resolver": patch
3+
---
4+
5+
Enhance logging

lib/src/logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface LogEntry {
2323

2424
export const createLogger = (config: LoggerConfig = {}) => {
2525
const mode: Mode = config.mode ?? "memory";
26-
const logDir = config.logDir ?? "logs";
26+
const logDir = config.logDir ?? ".logs";
2727
const singleFile = config.singleFile ?? false;
2828
const levels = {
2929
stdout: config.levels?.stdout ?? ["warn", "error"],

lib/src/normalizer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* and classifies rules into exact / top-level / glob categories.
55
*/
66

7+
import { globalLogger } from "./logger";
78
import { Matcher, basicMatcher, loadMatcher } from "./matcher";
89
import { InbuiltMergeStrategies, Config, RuleTree, StrategyFn } from "./types";
910

@@ -99,6 +100,9 @@ export const normalizeConfig = async <T extends string = InbuiltMergeStrategies>
99100
}
100101

101102
const fileFilter = (filepath: string) => {
103+
if (config.debug) {
104+
globalLogger.info("all", `[normalizer] Filtering ${filepath}`);
105+
}
102106
if (!matcher.isMatch(filepath, userConfig.include)) return false;
103107
if (matcher.isMatch(filepath, [...userConfig.exclude, "**/node_modules/**"])) return false;
104108
return true;

0 commit comments

Comments
 (0)