Remove the 6 remaining `console.*` calls from `src/` in favour of the configured logger
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 70/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nodejs, typescript
- Domain
- backend, observability
Research direction
Grep src/**/*.ts for console.log, debug, warn and error, then check each hit. Compare with src/rate-limiting/rate-limiter.service.ts and src/file-upload.controller.ts:47 to see the Logger pattern, and keep each original log level. Check each site for secrets before converting. Done when no console calls remain in src outside spec files, .eslintrc.js has the no-console rule, and npm run lint and npm test pass.
Written by the indexing model from the issue text.
Description
Problem
Six console.* calls remain in production source. The project has a full logging stack already — winston, pino, winston-daily-rotate-file, winston-cloudwatch in package.json, a dedicated src/logging/ module (14 files), and a custom GlobalExceptionFilter registered at src/app.module.ts:302-305.
Grep src/**/*.ts for console\.(log|debug|warn|error) and inspect each hit.
Why it matters
Direct console output bypasses every configured concern: it is not structured, not level-filtered, not routed to the rotating file or CloudWatch, and not tagged with the request or trace context that the OTel instrumentation attaches. In a production incident you would be grepping raw stdout while the rest of the system writes structured JSON.
The README's "Observable & auditable" design principle (line 32) and docs/monitoring.md both assume structured logging; these six calls are the exceptions.
Suggested Direction
- Locate all six sites.
- For Nest classes, use the built-in
private readonly logger = new Logger(ClassName.name)— this pattern is already used throughoutsrc/(for examplefile-upload.controller.ts:47). Callthis.logger.error(...)/warn(...)/log(...)with an object payload rather than string interpolation. - For services already using
winston, replace with their injected logger rather than adding a second one. - Guard against a real regression this exposes:
src/rate-limiting/rate-limiter.service.tsand the profiling services already use structured loggers. Match them. - Add
no-consoleto.eslintrc.jsto prevent regressions:'no-console': ['warn', { allow: ['warn', 'error'] }],
Note src/monitoring/monitoring-dashboard.spec.ts:32 matched a similar grep — confirm spec files are excluded or handled separately, since asserting on console output is legitimate in tests.
Constraints
- Log levels carry meaning here: do not convert an
errorinto alogto make output quieter. - Never log secrets, tokens, or wallet private keys — check each site for that before converting.
lintcurrently runs with--fixinpackage.json:18, so be aware the lint command will rewrite files.
Acceptance Criteria
- No
console.*calls remain insrc/outside spec files. - Each replacement preserves the original log level.
-
no-consoleis configured in.eslintrc.js. - No credentials or tokens are passed to any logger.
-
npm run lintandnpm testpass.
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 55
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 5
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SourceXXL/alian_structure-api
-
good first issue help wanted security
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SourceXXL/alian_structure-api#266 ·
-
Parallelize the cache-warming loop in `cache-warming.service.ts` — warmers run strictly sequentiallyPossibly taken @syntaxsuuvam-spec claimed this 4 days ago. Opengood first issue performance
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SourceXXL/alian_structure-api#240 ·
-
documentation help wanted intermediate refactor
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
SourceXXL/alian_structure-api#215 ·
-
good first issue refactor tooling
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
SourceXXL/alian_structure-api#199 ·
-
help wanted intermediate refactor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SourceXXL/alian_structure-api#196 ·
All issues in SourceXXL/alian_structure-api
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
juice-shop/juice-shop#3686 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dsh-market/dsh-market#877 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ScottKirvan/GOMAC#61 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stellar/stellar-dev-skill#151 ·
Maintainers usually reply within 1 day