feat: enhance configuration management and logging in the MoLing server#3
Merged
feat: enhance configuration management and logging in the MoLing server#3
Conversation
Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR enhances configuration management and logging for the MoLing server. It renames and repurposes configuration fields, updates logging levels, and refactors CLI command options.
- Rename FSRootPath to CachePath in the file system configuration.
- Update logging levels and add a debug flag.
- Modify CLI commands to use centralized configuration settings and directory lists.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| services/file_system_config.go | Renames field from FSRootPath to CachePath without updating JSON tag/comment consistency. |
| services/file_system.go | Updates file path join to use the newly renamed CachePath field. |
| services/config.go | Adds the Debug flag to the MoLingConfig. |
| services/command.go | Changes logging level from Info to Debug for the CommandServer config output. |
| cli/cmd/root.go | Introduces a config file constant and debug flag, and refactors base path usage. |
| cli/cmd/perrun.go | Uses the centralized mlDirectories constant for directory creation. |
| cli/cmd/config.go | Updates config command to initialize and display config details with the new logger setup. |
Comments suppressed due to low confidence (2)
services/file_system_config.go:34
- The field name 'CachePath' conflicts with its JSON tag 'fs_root_path' and comment indicating a file system root, which may lead to confusion regarding its actual purpose. Consider updating the JSON tag and comment to reflect that this field represents a cache path, or rename the field to match its intended usage.
CachePath string `json:"fs_root_path"` // CachePath is the root path for the file system.
cli/cmd/config.go:98
- [nitpick] The flag '--init' may be ambiguous regarding its purpose of saving the configuration to a file. Consider renaming the flag to '--save-config' or a similar descriptive name to better convey its functionality.
configCmd.PersistentFlags().BoolVar(&initial, "init", false, fmt.Sprintf("Save configuration to %s", filepath.Join(mlConfig.BasePath, MLConfigName)))
…lication Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
…uration format Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
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.
No description provided.