Repository navigation
Conversation
Replace ~50 console.log/warn/error/time calls with getScopedLogger() across 17 functions in lint.ts. Test functions intentionally preserved. Scopes added: LintWhitespace, LintDuplicates, LintUnreferencedDetails, LintDetails, LintTranslationSlugs, LintTranslationHeaders, LintSheet, LintCategoryIcons, LintCategories, LintTranslationSourceOverwrites, LintTranslations, LintTranslationConsistency, LintDialogHtml, LintFixTranslationSheets, LintAllSheets. Closes #35
Review Summary by QodoMigrate remaining console logging to scoped logger in lint.ts
WalkthroughsDescription• Migrated ~50 console.log/warn/error/time calls to scoped logger • Replaced console.time/timeEnd with logger.debug calls across 15 functions • Applied appropriate log levels: info for operations, warn for edge cases, error for failures, debug for details • Test functions intentionally preserved to maintain test output behavior Diagramflowchart LR
A["console.log/warn/error/time calls"] -->|"Replace with getScopedLogger"| B["Scoped logger instances"]
B -->|"Map log levels"| C["info/warn/error/debug"]
C -->|"Applied to 15 functions"| D["Linting functions"]
D -->|"Preserve test output"| E["Test functions unchanged"]
File Changes1. src/lint.ts
|
Code Review by Qodo
1.
|
Greptile review feedback: logger was instantiated per-iteration inside for loops and in catch blocks, despite already being hoisted to function top in checkUnreferencedDetails. Removed 4 redundant getScopedLogger calls across checkUnreferencedDetails and checkDuplicateTranslationSlugs.
luandro
added a commit
that referenced
this pull request
Jun 4, 2026
Apply scoped logger migration to the split lint module files. Replaces console.log/warn/error/time with getScopedLogger() calls across 6 files (73 replacements total). Test functions intentionally preserved. This makes PR #43 (fix/35-lint-scoped-logger) redundant since the logger migration is now included in the lint split.
Contributor
Author
|
Superseded by PR #46 which now includes both the lint split AND the scoped logger migration. No need for a separate PR. |
luandro
added a commit
that referenced
this pull request
Jun 6, 2026
Apply scoped logger migration to the split lint module files. Replaces console.log/warn/error/time with getScopedLogger() calls across 6 files (73 replacements total). Test functions intentionally preserved. This makes PR #43 (fix/35-lint-scoped-logger) redundant since the logger migration is now included in the lint split.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
src/lint.tshad ~50console.log/console.warn/console.error/console.timecalls mixed withgetScopedLogger()calls. The rest of the codebase has been fully migrated to scoped logging.Changes
Replaced all non-test
console.*calls with appropriategetScopedLogger()calls across 17 functions:Log level mapping
logger.infologger.warnlogger.errorlogger.debugconsole.time/console.timeEnd→logger.debug(GAS does not support console.time)Not modified
testHtmlValidation,testDialogHtmlGeneration,runAllHtmlValidationTests) — intentional test output preservedNo behavior changes. Pure logging migration.
Closes #35
Greptile Summary
This PR migrates all remaining
console.log/console.warn/console.error/console.timecalls insrc/lint.tsto the project'sgetScopedLogger()API, completing the codebase-wide structured logging migration. Log level mapping follows the documented convention (info for lifecycle events, warn for edge cases, error for failures, debug for detail/former timing markers).[ScopeName]prefix.console.time/console.timeEndpairs removed inlintSheet(including thefinallyblock) and replaced withlogger.debugstart markers; GAS does not supportconsole.time, making this a correctness improvement on that runtime.console.*output intestHtmlValidation,testDialogHtmlGeneration, andrunAllHtmlValidationTests.Confidence Score: 4/5
Safe to merge; this is a pure logging substitution with no changes to lint logic, sheet mutations, or return values.
All 17 functions are cleanly migrated and logger placement is correct at function entry in the vast majority of cases. An open thread from a prior review notes that the logger in checkDuplicateTranslationSlugs is created inside the inner column loop, making it technically out of scope for the catch block — that remains unresolved in this version. No other logic is touched.
src/lint.ts — specifically the checkDuplicateTranslationSlugs function where the logger scope concern from the prior review is still open.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[lint.ts function called] --> B[getScopedLogger at function entry] B --> C{Operation type} C -->|lifecycle start/end| D[logger.info] C -->|edge case or empty sheet| E[logger.warn] C -->|exception caught| F[logger.error] C -->|diagnostic detail or former console.time| G[logger.debug] D --> H[AppAppLogger.scope prepends ScopeName] E --> H F --> H G --> H H --> I[console.log / console.warn / console.error via AppAppLogger.output]Comments Outside Diff (1)
src/lint.ts, line 1370-1379 (link)checkUnreferencedDetails— once inside the early-exitif, once inside theforloop on every unreferenced entry, and once in thecatchblock. The per-iteration instantiation in the loop is the main concern: whenAppLoggeris live,scope()allocates a new logger object on each call. Hoist a singlegetScopedLogger("LintUnreferencedDetails")call to the top of the function.Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Reviews (2): Last reviewed commit: "refactor: hoist getScopedLogger calls ou..." | Re-trigger Greptile