Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
fabfileでセロリタスクとして定義されたファブリック関数を実行しようとしています。タスクが実行されるたびに、別のログファイルを作成する必要があります。タイムスタンプに応じて毎回ログファイルのパスを設定するにはどうすればよいですか。ユーザーが展開プロセス全体またはプロセスのエラーを確認できるように、最後にこのログファイルのリンクをダウンロードできるようにする必要があります。
ありがとう、ローハン
task.get_logger引数をサポートしているlogfileので、次のようなことができるはずです。
task.get_logger
logfile
@task def mytask(): logger = self.get_logger(logfile="foo.log") logger.info("logging from mytask")