Skip to content

Conversation

@AleksandrSl
Copy link
Collaborator

@AleksandrSl AleksandrSl commented Dec 23, 2025

Summary

We don't really need to initialize it inside the server, since server is only a way to use the service in the dev mode.

Logs of the server are written to a file due to it being started from process which doesn't have access to console. But we want to see TranslationService initialization logs in the console, and the clearest way is to start it early, rather than extracting validation into a separate function.

Changes

  • Shows TranslationService logs in the console instead of log file

Checklist

  • Changeset added (if version bump needed)
  • Tests cover business logic (not just happy path)
  • No breaking changes (or documented below)

`Initializing Lingo.dev compiler. Is dev mode: ${isDev}. Is main runner: ${isMainRunner()}`,
);

// TODO (AleksandrSl 12/12/2025): Add API keys validation too, so we can log it nicely.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what is solved in the PR

Comment on lines -750 to -752
if (!this.translationService) {
throw new Error("Translation service not initialized");
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite dumb check, we make sure TranslationService is never null in constructor, since it's not something heavy we should delay creating

const delay = this.config?.delayMedian ?? 0;
const actualDelay = this.getRandomDelay(delay);

this.logger.debug(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were mostly added by LLM for debugging, we can add them back with LLM if needed

@AleksandrSl AleksandrSl force-pushed the feat/compiler-show-translation-service-logs-in-console branch 3 times, most recently from 91c0bef to 85ceb48 Compare December 23, 2025 23:35
We don't really need to initialize it inside the server,
since server is only a way to use the service in the dev mode.

Logs of the server are written to a file due to it being started
from process which doesn't have access to console.
But we want to see TranslationService initialization logs
in the console, and the clearest way is to start it early,
rather than extracting validation into a separate function.
@AleksandrSl AleksandrSl force-pushed the feat/compiler-show-translation-service-logs-in-console branch from 85ceb48 to bed9c1f Compare December 23, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants