Conversation
…nhance logging Signed-off-by: Adrián Constante <ad_con.reload@proton.me>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the BasculaServicio project to run as a Windows service using the go-svc library, enabling proper service lifecycle management with start/stop functionality and enhanced logging capabilities.
- Implements the svc.Service interface with Program struct for proper service lifecycle management
- Adds Windows service installation/management scripts and logging to PROGRAMDATA directory
- Sets default configuration to test mode for easier development
Reviewed Changes
Copilot reviewed 7 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/BasculaServicio/main.go | Refactored to implement svc.Service interface with Program struct and file-based logging |
| web/html/index_config.html | Updated checkbox to be checked by default for test mode |
| scripts/install.bat | Added Windows service installation script with hardcoded paths |
| scripts/uninstall.bat | Added Windows service removal script |
| scripts/commands.bat | Added service management commands with incorrect batch file syntax |
| go.mod | Updated dependencies to include go-svc library |
| cmd/BasculaServicio/docs.go | Added package documentation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adrián Constante <ad_con.reload@proton.me>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adrián Constante <ad_con.reload@proton.me>
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.
This pull request refactors the
BasculaServicioproject to run as a proper Windows service, using thego-svclibrary for lifecycle management. It also introduces scripts for installing, uninstalling, and managing the service, improves logging, and sets the default to "test mode" for easier development and debugging.Key changes include:
Service Daemonization & Lifecycle Management:
svc.Serviceinterface using thego-svclibrary, enabling the program to run as a Windows service with proper start/stop handling and signal management. (cmd/BasculaServicio/main.go[1] [2]Programstruct withInit,Start, andStopmethods to manage service lifecycle, including graceful shutdown and goroutine management. (cmd/BasculaServicio/main.go[1] [2]Logging Improvements:
%PROGRAMDATA%\BasculaServicio\service.logdirectory, ensuring logs are persisted and accessible for troubleshooting. (cmd/BasculaServicio/main.gocmd/BasculaServicio/main.goL334-R410)Configuration & Defaults:
cmd/BasculaServicio/main.gocmd/BasculaServicio/main.goL31-R83)web/html/index_config.htmlweb/html/index_config.htmlL15-R15)Build & Service Management Scripts:
install.batanduninstall.batscripts for easy installation and removal of the Windows service, including automatic startup and description. (scripts/install.bat[1]scripts/uninstall.bat[2]commands.batwith shortcuts for starting, stopping, restarting, and querying the service status. (scripts/commands.batscripts/commands.batR1-R11)Dependency Updates:
go.modto addgo-svcand update other dependencies to ensure compatibility with the new service management approach. (go.modgo.modL6-R13)Minor:
docs.godescribing the purpose of the service. (cmd/BasculaServicio/docs.gocmd/BasculaServicio/docs.goR1-R2)