Allow user to replace all uses of STDOUT/STDERR for logging
まだ誰も着手していません。
評価
調査の方向性
まず、FFmpeg プロセスの出力を System.out と System.err に書き込むコードパスを、現在カスタマイズに必要な継承フックも含めて特定します。設計の入り口として、提案されている FFmpegCommon.setLoggingSystem と appendLog インターフェースを使用します。完了の条件は、デフォルトの動作を変更せずに呼び出し元が両方のストリームをリダイレクトできることです。
索引モデルが issue の本文から書いたものです。
説明
Hello,
I deploy this library in an environment where the java processes stdout and stderr is discarded and there is no way for the developer
maintainer to see it.
I would like the ffmpeg errors to be captured without involving stderr as they are usefull to diagnose some errors.
To capture the errors you would need to either log them into java.util.logging or the slf4j logging facade.
I understand that you may not wish to include slf4j as a dependency.
I know that some people hate java.util.logging (and would prefer not to have to use it)
So my suggestion would be to have a global static variable that the user can set that determines where log lines get pumped to.
The default implementation would pump to stdout/stderr just like it currently does but I could then in my bootstrap of my application call
"FFmpegCommon.setLoggingSystem(FFmpegLoggingManager instance)" (just an example)
If I were to design this interface then I would give it only 1 method that looks like this:
void appendLog(Process ffmpegProc, boolean isStdErr, byte[] data, int off, int len);
If you do not want to hand in the process then please pass some unique identifier (aka process pid for example or a random UUID instead so I can tell appart error messages from multiple concurrent ffmpeg jobs)
I would outsource line breaks and all that thing to concrete implementations.
Currently I have to hack very deep into your library using inheritance to be able to accomplish this.
The default implementation that dumps everything to stdout/stderr could probably be as simple as this:
public void appendLog(Process ffmpegProc, boolean isStdErr, byte[] data, int off, int len) {
PrintStream stream = isStdErr ? System.err : System.out;
try {
stream.write(data, off, len);
} catch(Exception e) {
//IGNORED
}
}
Sincerely
Alexander Schütz
- 主要言語
- Java
- スター
- 1.9k
- フォーク
- 424
- 平均マージ
- 6時間 7分
- マージ済み PR(30日)
- 6
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bramp/ffmpeg-cli-wrapper のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
bramp/ffmpeg-cli-wrapper#408 · コメント 1 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
bramp/ffmpeg-cli-wrapper#392 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
bramp/ffmpeg-cli-wrapper#384 · コメント 5 件 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
bramp/ffmpeg-cli-wrapper#383 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
bramp/ffmpeg-cli-wrapper#382 · コメント 1 件 ·
bramp/ffmpeg-cli-wrapper の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
ci-failure-cause test-failure
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
nextcloud/notes-android#3367 ·
メンテナーはふだん 1 日以内に返信
-
Feature
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
MuntashirAkon/AppManager#2058 ·
-
SarifLogger: artifactLocation.uri is not properly encoded for file names containing '#', '?', or '%'オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
checkstyle/checkstyle#21721 ·
メンテナーはふだん 1 日以内に返信