Skip to content

Conversation

@jfeingold35
Copy link
Contributor

Adds a new log event near the very beginning of action execution, which indicates where logs are being written to. This way, if the process appears to hang or is taking a long time, the user knows where to look for additional logging.
Example of this new message in use (the "Streaming logs in real time to:" message):
Screenshot 2025-02-18 at 11 46 49 AM

@@ -1,3 +1,7 @@
# common.streaming-logs-to

**Streaming logs in real time to:**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jshackell-sfdc , Net-new message. Example of its use can be seen in the PR's description section.

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM (although I assume you'll remove the ** around the message? Or do you intend to leave that? It looks odd to me...)


// We always add a Logger Listener to the appropriate listeners list, because we should always be logging.
const logFileWriter: LogFileWriter = await LogFileWriter.fromConfig(userConfig);
this.dependencies.actionSummaryViewer.viewPreExecutionSummary(logFileWriter.getLogDestination());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the functional change to this Action. I added it as early in the method as I could (i.e., immediately after the log file writer is instantiated) to minimize the possibility of it being preempted by an error.
If we want, though, we could easily move it further down and use it in the future to log additional information about, for example, the engines that are added. I'm flexible on this.

public async execute(input: RulesInput): Promise<void> {
const config: CodeAnalyzerConfig = this.dependencies.configFactory.create(input['config-file']);
const logWriter: LogFileWriter = await LogFileWriter.fromConfig(config);
this.dependencies.actionSummaryViewer.viewPreExecutionSummary(logWriter.getLogDestination());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the functional change to this Action. I added it as early in the method as I could (i.e., immediately after the log file writer is instantiated) to minimize the possibility of it being preempted by an error.
If we want, though, we could easily move it further down and use it in the future to log additional information about, for example, the engines that are added. I'm flexible on this.

public async execute(input: RunInput): Promise<void> {
const config: CodeAnalyzerConfig = this.dependencies.configFactory.create(input['config-file']);
const logWriter: LogFileWriter = await LogFileWriter.fromConfig(config);
this.dependencies.actionSummaryViewer.viewPreExecutionSummary(logWriter.getLogDestination());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the functional change to this Action. I added it as early in the method as I could (i.e., immediately after the log file writer is instantiated) to minimize the possibility of it being preempted by an error.
If we want, though, we could easily move it further down and use it in the future to log additional information about, for example, the engines that are added. I'm flexible on this.

this.display = display;
}

public viewPreExecutionSummary(logFile: string): void {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Display object isn't directly accessible to the Action layer, so I opted to add the pre-execution output as another capability of the ActionSummaryViewer family instead of giving the Actions a new Dependency.

}

public view(logFile: string, outfile?: string): void {
public viewPostExecutionSummary(logFile: string, outfile?: string): void {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The concrete summary viewers' view method was renamed to viewPostExecutionSummary to distinguish it from the net-new viewPreExecutionSummary.

public view(logFile: string, outfile?: string): void {
public viewPostExecutionSummary(logFile: string, outfile?: string): void {
// Start with separator to cleanly break from anything that's already been logged.
this.displayLineSeparator();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was missing the leading newline that all the other summary viewers have, so I went ahead and added it.

Copy link
Contributor

@stephen-carter-at-sf stephen-carter-at-sf left a comment

Choose a reason for hiding this comment

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

Approved pending Juliet's approval.

@jfeingold35 jfeingold35 marked this pull request as ready for review February 18, 2025 18:47
@jfeingold35 jfeingold35 merged commit c88ea0f into dev Feb 18, 2025
12 checks passed
@stephen-carter-at-sf stephen-carter-at-sf deleted the d/W-17701097 branch April 2, 2025 12:50
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.

4 participants