TWSD-616 Show specific number of cloud HA CLI log

Review Request #746 — Created March 27, 2025 and submitted

jasonchang
APV10
rel_apv_10_7_3
marychou, timsu, weikai

Previously, the cloud aws show log buffer function did not take any arguments and printed all the logs stored in the file. The updated version now accepts an argument, num_of_lines, allowing users to specify the number of log lines to print. (Default: 0, which prints the entire log.)

Changes Implemented:

  • usr/click/lib/libparser/commands.pm

Added an unsigned int argument (num_of_lines, default: 0) to the cloud_aws_show_log_buffer command.

  • usr/click/bin/backend/sys_cmd.c

Updated the Python command to include the -num-lines argument:

snprintf(cmd, sizeof(cmd), "python3 /ca/bin/aws/LoggerManager.py -mode show -num-lines %u", num_of_lines);

  • usr/click/tools/aws/LoggerManager.py, usr/click/tools/aws/logger/ProxyAWSLogger.py

Modified the function to print a specific number of log lines if the argument is provided.

If num_of_lines is 0 or not provided, it prints the entire log.

AN(config)#cloud aws show log buffer 2
[2025-03-26T08:39:50] - [INFO] show log in information with access key: *H34B
[2025-03-26T08:39:54] - [INFO] show log in information with access key: *H34B

AN(config)#cloud aws show log buffer 5
[2025-02-21T03:38:52] - [INFO] check AWSFailoverPoller.py status: not running
[2025-02-21T03:38:53] - [INFO] Successfully get ENI configuration
[2025-03-26T06:53:22] - [INFO] show log in information with access key: *H34B
[2025-03-26T08:39:50] - [INFO] show log in information with access key: *H34B
[2025-03-26T08:39:54] - [INFO] show log in information with access key: *H34B

AN(config)#cloud aws show log buffer 3
[2025-03-26T06:53:22] - [INFO] show log in information with access key: *H34B
[2025-03-26T08:39:50] - [INFO] show log in information with access key: *H34B
[2025-03-26T08:39:54] - [INFO] show log in information with access key: *H34B

Description From Last Updated

You add your code from the older code base, aren't you? You need to checkout the latest code base and …

marychoumarychou
jasonchang
timsu
  1. Ship It!
  2. 
      
jasonchang
marychou
  1. 
      
  2. You add your code from the older code base, aren't you?
    You need to checkout the latest code base and then add your code.

  3. 
      
marychou
  1. Ship It!
  2. 
      
jasonchang
weikai
  1. Ship It!
  2. 
      
jasonchang
Review request changed

Status: Closed (submitted)

Loading...