Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command_checker and setup_logger to script/deploy_helper.py #17

Merged
merged 7 commits into from
Aug 8, 2024

Conversation

ajiankexx
Copy link

  • Add command_checker function to verify command execution.
  • Add setup_logger function to configure the logging system.
  • Replace some code with command_checker.

@ajiankexx ajiankexx changed the title 在deploy_helper.py中增加checker以及logger Reply:在deploy_helper.py中增加checker以及logger Jul 31, 2024
@ajiankexx ajiankexx changed the title Reply:在deploy_helper.py中增加checker以及logger Add command_checker and setup_logger to script/deploy_helper.py Jul 31, 2024
@Kaiser-Yang Kaiser-Yang added the project initialization Building the project framework for the first time label Aug 1, 2024
ajiankexx added a commit that referenced this pull request Aug 1, 2024
- Modify the format of the log message in command_checker to improve readability

- Delete parameter 0 in each call of command_checker when the parameter
  expected status code is 0

- Add support for setting log level of setup_logger when executing
  deploy_helper.py in shell

Resolves: #17
Resolves: #10
ajiankexx added a commit that referenced this pull request Aug 1, 2024
- Modify the format of the log message in command_checker to improve readability

- Delete parameter 0 in each call of command_checker when the parameter
  expected status code is 0

- Add support for setting log level of setup_logger when executing
  deploy_helper.py in shell

Resolves: #17
Resolves: #10
@ajiankexx ajiankexx force-pushed the nt-dev branch 2 times, most recently from d6fe352 to 9a395e8 Compare August 1, 2024 14:56
ajiankexx added a commit that referenced this pull request Aug 1, 2024
- Modify the format of the log message in command_checker to improve readability

- Delete parameter 0 in each call of command_checker when the parameter
  expected status code is 0

- Add support for setting log level of setup_logger when executing
  deploy_helper.py in shell

Resolves: #17
Resolves: #10
ajiankexx added a commit that referenced this pull request Aug 1, 2024
In script/deploy_helper.py, add two functions named command_checker and
setup_logger. And substitute some code with command_checker.Below are
their functions:

- Add command_checker function to check if a command execute
  successfully. If executing failed, command_checker will output error
  log and status code. If executing successfully, nothing will happen.

- Add setup_logger function to configure the logging system. It will
  create a logger object and set the log level to INFO. Also, user can
  set the log level using --log-level option.

- Replace some code like 'res=...if res!=0' with command_checker.

See: #17
ajiankexx added a commit that referenced this pull request Aug 1, 2024
- Modify the format of the log message in command_checker to improve readability

- Delete parameter 0 in each call of command_checker when the parameter
  expected status code is 0

- Add support for setting log level of setup_logger when executing
  deploy_helper.py in shell

Resolves: #17
ajiankexx added a commit that referenced this pull request Aug 1, 2024
- Modify the format of the log message in command_checker to improve readability

- Delete parameter 0 in each call of command_checker when the parameter
  expected status code is 0

- Add support for setting log level of setup_logger when executing
  deploy_helper.py in shell

Resolves: #17
ajiankexx added a commit that referenced this pull request Aug 1, 2024
Translate original Chinese comments in command_checker and setup_logger in script/deploy_helper.py into English.

See: #17
ajiankexx added a commit that referenced this pull request Aug 1, 2024
- Modify the format of the log message in command_checker to improve readability

- Delete parameter 0 in each call of command_checker when the parameter
  expected status code is 0

- Add support for setting log level of setup_logger when executing
  deploy_helper.py in shell

Resolves: #17
ajiankexx added a commit that referenced this pull request Aug 1, 2024
In script/deploy_helper.py, add two functions named command_checker and
setup_logger. And substitute some code with command_checker.Below are
their functions:

- Add command_checker function to check if a command execute
  successfully. If executing failed, command_checker will output error
  log and status code. If executing successfully, nothing will happen

- Add setup_logger function to configure the logging system. It will
  create a logger object and set the log level to INFO. Also, user can
  set the log level using --log-level option

- Replace some code like 'res=...if res!=0' with command_checker

See: #17
ajiankexx added a commit that referenced this pull request Aug 1, 2024
Translate original Chinese comments in command_checker and setup_logger in script/deploy_helper.py into English

See: #17
ajiankexx added a commit that referenced this pull request Aug 1, 2024
- Modify the format of the log message in command_checker to improve readability

- Delete parameter 0 in each call of command_checker when the parameter
  expected status code is 0

- Add support for setting log level of setup_logger when executing
  deploy_helper.py in shell

Resolves: #17
ajiankexx added a commit that referenced this pull request Aug 2, 2024
In script/deploy_helper.py, add two functions named command_checker and
setup_logger. And substitute some code with command_checker.Below are
their functions:
- Add command_checker function to check if a command execute
successfully. If executing failed, command_checker will output error
log and status code. If executing successfully, nothing will happen.
- Add setup_logger function to configure the logging system. It will
create a logger object and set the log level to INFO. Also, user can
set the log level using --log-level option.
- Replace some code like 'res=...if res!=0' with command_checker.

See: #17
ajiankexx added a commit that referenced this pull request Aug 2, 2024
Translate original Chinese comments in command_checker and setup_logger
in script/deploy_helper.py into English.

See: #17
ajiankexx added a commit that referenced this pull request Aug 2, 2024
- Modify the format of the log message in command_checker to improve
readability.
- Delete parameter 0 in each call of command_checker when the parameter
expected status code is 0.
- Add support for setting log level of setup_logger when executing
deploy_helper.py in shell.

Resolves: #17
ajiankexx added a commit that referenced this pull request Aug 2, 2024
- Modify the format of the log message in command_checker to improve
readability.
- Delete parameter 0 in each call of command_checker when the parameter
expected status code is 0.
- Add support for setting log level of setup_logger when executing
deploy_helper.py in shell.

See: #17
ajiankexx added a commit that referenced this pull request Aug 2, 2024
- Add the current file name in the output log.
- Modify the behavior of command_checker. Now it will only output the
content in parameter of message.
- Add command_checker for each call of os.system().
- Use """ """ instead of " " to output log.

Resolves: #17
In script/deploy_helper.py, add two functions named command_checker and
setup_logger. And substitute some code with command_checker.Below are
their functions:
- Add command_checker function to check if a command execute
successfully. If executing failed, command_checker will output error
log and status code. If executing successfully, nothing will happen.
- Add setup_logger function to configure the logging system. It will
create a logger object and set the log level to INFO. Also, user can
set the log level using --log-level option.
- Replace some code like 'res=...if res!=0' with command_checker.

See: #17
Translate original Chinese comments in command_checker and setup_logger
in script/deploy_helper.py into English.

See: #17
- Modify the format of the log message in command_checker to improve
readability.
- Delete parameter 0 in each call of command_checker when the parameter
expected status code is 0.
- Add support for setting log level of setup_logger when executing
deploy_helper.py in shell.

See: #17
- Add information of developer ajiankexx to pom.xml

See: #12
ajiankexx added a commit that referenced this pull request Aug 4, 2024
- Add the current file name in the output log.
- Modify the behavior of command_checker. Now it will only output the
content in parameter of message.
- Add command_checker for each call of os.system().
- Use """ """ instead of " " to output log.

Resolves: #17
- Add the current file name in the output log.
- Modify the behavior of command_checker. Now it will only output the
content in parameter of message.
- Add command_checker for each call of os.system().
- Use """ """ instead of " " to output log.

See: #17
ajiankexx added a commit that referenced this pull request Aug 8, 2024
- Add support for showing the line number of the command_checker to
help the user to find which command failed.
- Modify the format how the log is printed.
- Add two vars message_tmp and command to store the template of the
message and the command to be executed respectively. It will make codes
more readable and easier to understand.

Resolves: #17
- Add support for showing the line number of the command_checker to
help the user to find which command failed quickly.
- Modify the format how the log is printed.
- Add two vars message_tmp and command to store the template of the
message and the command to be executed respectively. It will make codes
more readable and easier to understand.

Resolves: #17
@luckygalaxy666 luckygalaxy666 merged commit 6ed74c4 into develop Aug 8, 2024
1 check passed
@ajiankexx ajiankexx deleted the nt-dev branch August 21, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project initialization Building the project framework for the first time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants