Skip to content

Refactor logging and environment parsing to use package:google_cloud#101

Draft
kevmoo wants to merge 1 commit intomainfrom
gcloud
Draft

Refactor logging and environment parsing to use package:google_cloud#101
kevmoo wants to merge 1 commit intomainfrom
gcloud

Conversation

@kevmoo
Copy link
Copy Markdown
Collaborator

@kevmoo kevmoo commented Mar 31, 2026

Integrates package:google_cloud for structured logging, trace context, and standard environment variables.

Details:

  • Update Logger to extend CloudLogger from package:google_cloud.
  • Replace custom trace context parsing and zone keys with TraceContextData and standard constants.
  • Update fireUp server startup to use TraceContextData.tryParse.
  • Remove custom removeCircular logic and related tests (offloaded to google_cloud).
  • Upgrade google_cloud_storage to ^0.6.0 and add google_cloud dependency.
  • Modernize logging calls throughout (logger.warning with stackTrace etc).
  • Remove obsolete server_test.dart for custom trace parsing.
  • Use standard constants for environment variables (e.g., serviceEnvironmentVariable, projectIdEnvironmentVariableOptions).

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request migrates the logging infrastructure to use package:google_cloud. Key changes include replacing the internal LogSeverity and LogEntry definitions with those from the external package, updating the Logger class to extend CloudLogger, and integrating TraceContextData for trace propagation. Additionally, standard print statements have been replaced with structured logger.warning calls, and error logging has been simplified by passing StackTrace objects directly to the logger. A high-severity issue was identified in the log method where LogSeverity is incorrectly accessed via a non-existent value property instead of index for severity comparison.

@kevmoo kevmoo force-pushed the gcloud branch 3 times, most recently from 5272ce2 to cdc730c Compare March 31, 2026 22:25
@kevmoo
Copy link
Copy Markdown
Collaborator Author

kevmoo commented Mar 31, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request migrates the project to package:google_cloud for logging and HTTP serving, updating the Logger to extend CloudLogger and refactoring the server startup logic. Feedback points out a compilation error in the fireUp function and a regression in trace propagation that needs to be fixed by manually populating the Zone with trace data.

Integrates `package:google_cloud` for structured logging, trace context, and standard environment variables.

Details:
- Update `Logger` to extend `CloudLogger` from `package:google_cloud`.
- Replace custom trace context parsing and zone keys with `TraceContextData` and standard constants.
- Update `fireUp` server startup to use `TraceContextData.tryParse`.
- Remove custom `removeCircular` logic and related tests (offloaded to `google_cloud`).
- Upgrade `google_cloud_storage` to `^0.6.0` and add `google_cloud` dependency.
- Modernize logging calls throughout (`logger.warning` with `stackTrace` etc).
- Remove obsolete `server_test.dart` for custom trace parsing.
- Use standard constants for environment variables (e.g., `serviceEnvironmentVariable`, `projectIdEnvironmentVariableOptions`).
@kevmoo
Copy link
Copy Markdown
Collaborator Author

kevmoo commented Mar 31, 2026

/gemini review

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@kevmoo kevmoo marked this pull request as draft April 1, 2026 04:00
@kevmoo
Copy link
Copy Markdown
Collaborator Author

kevmoo commented Apr 1, 2026

/gemini review

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

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.

1 participant