bbovenzi commented on code in PR #71156:
URL: https://github.com/apache/airflow/pull/71156#discussion_r3731657810
##########
airflow-core/src/airflow/ui/src/queries/useLogs.tsx:
##########
@@ -36,10 +41,47 @@ import { parseStreamingLogContent } from "src/utils/logs";
export type ParsedLogEntry = {
element: JSX.Element | string | undefined;
+ getPlainText?: () => string;
group?: { id: number; level: number; parentId?: number; type: "header" |
"line" };
lineNumber?: number;
};
+type GetLogLineTextOptions = {
+ logLevelFilters?: Array<string>;
+ logMessage: string | StructuredLogMessage;
+ showSource?: boolean;
+ showTimestamp?: boolean;
+ sourceFilters?: Array<string>;
+ translate: TFunction;
+};
+
+/**
+ * Plain-text rendering of a single log line — same pipeline as the log
+ * download, with ANSI escape codes stripped. Used to rebuild copied text for
+ * selected rows the virtualizer has unmounted.
+ */
+export const getLogLineText = ({
+ logLevelFilters,
+ logMessage,
+ showSource,
+ showTimestamp,
+ sourceFilters,
+ translate,
+}: GetLogLineTextOptions): string =>
+ Anser.ansiToText(
+ renderStructuredLog({
+ index: 0,
+ logLevelFilters,
+ logLink: "",
+ logMessage,
+ renderingMode: "text",
Review Comment:
I think a user is expecting their copy to be what they see on the screen. So
yes the timestamp and the arrow marker.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]