简体   繁体   English

如何将日志从代工厂平台的代码库写入新文件

[英]How to Write logs into new file from Code Repository in foundry Platform

In code Repository when I am previewing or testing *.py file I need to put all logs into a file if already file exists logs should be appended to that file with time.在代码存储库中,当我预览或测试 *.py 文件时,我需要将所有日志放入一个文件中,如果已经存在文件,日志应该随时间附加到该文件中。 Can anyone please suggest a way for this?任何人都可以请为此建议一种方法吗?

Explanation: I was doing pytest to test my code functionality so I want to keep test results into file that can be of.txt as I will specify the path of the file the file need to be created in the path specified with test results in it, if again tests are runned then that test results should be appended to the same file with timestamp.说明:我正在做 pytest 来测试我的代码功能,所以我想将测试结果保存到可以是 of.txt 的文件中,因为我将指定文件的路径,该文件需要在指定的路径中创建,其中包含测试结果,如果再次运行测试,则应将该测试结果附加到具有时间戳的同一文件中。

The CI shouldn't push things to git. CI 不应该把事情推到 git。 To be honest I don't even know if it has write permissions.老实说,我什至不知道它是否具有写权限。 This means that you can't write your test results to a file within a foundry CI run.这意味着您无法将测试结果写入代工厂 CI 运行中的文件。 The test results are always available in the CI runs though, you just need to open the checks to see them.测试结果在 CI 运行中始终可用,您只需打开检查即可查看它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Palantir Foundry 中读取和写入同一个文件? - How to read from and write to the same file in Palantir Foundry? PySpark dataframe(Foundry 代码存储库环境)中的洗牌行 - Shuffling rows in PySpark dataframe (Foundry code-repository environment) 在 Palantir Foundry 代码存储库中定义 Pandas UDF 的正确方法是什么 - What is the proper way to define a Pandas UDF in a Palantir Foundry Code Repository 如何使用 Palantir Foundry 在 Pyspark 中编写 case 语句 - How do I write case statements in Pyspark using Palantir Foundry 如何使用来自 Foundry Transforms 的 spark.DataFrameReader - How to use spark.DataFrameReader from Foundry Transforms 如何通过将数据帧作为输入来编写 pytest 以获取 palantir 代工厂中的所有必需值 - How to write pytest by taking dataframe as an input to fetch all the required values in palantir foundry 如何从 AWS 日志中读取 stderr 日志 - How to read stderr logs from AWS logs 如何将pyspark日志输出到文件 - How to output pyspark logs to a file 如何减少 Python 代码将数据写入镶木地板文件所花费的时间? - how to decrease time taken by the Python code to write data to parquet file? 如何在代码工作簿中合并 Palantir Foundry 中的两个数据集? - How do I union two datasets in Palantir Foundry within a code workbook?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM