2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
FileLogger
public
class
FileLogger
extends BaseStreamLogger<SizeLimitedOutputStream>
ログ メッセージをファイルと stdout に転送する ILeveledLogOutput
。
概要
保護されたメソッド |
void
|
init(String logPrefix, String fileSuffix)
ファイル名と接尾辞を指定する init() の代替。
|
パブリック コンストラクタ
FileLogger
public FileLogger ()
パブリック メソッド
clone
public ILeveledLogOutput clone ()
現在のオブジェクトと同じログレベル設定で新しい FileLogger
を作成します。
基盤となるログファイルの内容はコピーされません(つまり、クローンのログデータは新しいファイルに書き込まれます)。
closeLog
public void closeLog ()
getMaxLogSizeMbytes
public long getMaxLogSizeMbytes ()
ログの最大ログサイズを MB 単位で返します。
保護されたメソッド
init
protected void init (String logPrefix,
String fileSuffix)
ファイル名と接尾辞を指定する init()
の代替手段。
パラメータ |
logPrefix |
String : 拡張子なしでログに記録するファイル名。 |
fileSuffix |
String : ログを記録するファイルの拡張子。 |
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-27 UTC。"],[],[],null,["# FileLogger\n==========\n\n\n`\npublic\n\n\nclass\nFileLogger\n`\n\n\n`\n\n\n`\n\n`\n\n\n`\n\n`\n\nextends `[BaseStreamLogger](../../../../../../reference/tradefed/com/android/tradefed/log/BaseStreamLogger.html)`\u003c`[SizeLimitedOutputStream](../../../../../../reference/tradefed/com/android/tradefed/util/SizeLimitedOutputStream.html)`\u003e\n\n\n`\n\n`\n\n\n`\n\n|---|---|---|-------------------------------------|\n| java.lang.Object ||||\n| ↳ | [com.android.tradefed.log.BaseLeveledLogOutput](../../../../../../reference/tradefed/com/android/tradefed/log/BaseLeveledLogOutput.html) |||\n| | ↳ | [com.android.tradefed.log.BaseStreamLogger](../../../../../../reference/tradefed/com/android/tradefed/log/BaseStreamLogger.html)\\\u003c[com.android.tradefed.util.SizeLimitedOutputStream](../../../../../../reference/tradefed/com/android/tradefed/util/SizeLimitedOutputStream.html)\\\u003e ||\n| | | ↳ | com.android.tradefed.log.FileLogger |\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known direct subclasses [HistoryLogger](../../../../../../reference/tradefed/com/android/tradefed/log/HistoryLogger.html) |---------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------| | [HistoryLogger](../../../../../../reference/tradefed/com/android/tradefed/log/HistoryLogger.html) | TF History Logger, special log that contains only some specific events. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA [ILeveledLogOutput](../../../../../../reference/tradefed/com/android/tradefed/log/ILeveledLogOutput.html) that directs log messages to a file and to stdout.\n\nSummary\n-------\n\n| ### Public constructors ||\n|------------------------------------------------------------------------------------------------------------------|---|\n| ` `[FileLogger](../../../../../../reference/tradefed/com/android/tradefed/log/FileLogger.html#FileLogger())`() ` |\n\n| ### Public methods ||\n|-----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` `[ILeveledLogOutput](../../../../../../reference/tradefed/com/android/tradefed/log/ILeveledLogOutput.html) | ` `[clone](../../../../../../reference/tradefed/com/android/tradefed/log/FileLogger.html#clone())`() ` Creates a new [FileLogger](../../../../../../reference/tradefed/com/android/tradefed/log/FileLogger.html) with the same log level settings as the current object. |\n| ` void` | ` `[closeLog](../../../../../../reference/tradefed/com/android/tradefed/log/FileLogger.html#closeLog())`() ` |\n| ` `[InputStreamSource](../../../../../../reference/tradefed/com/android/tradefed/result/InputStreamSource.html) | ` `[getLog](../../../../../../reference/tradefed/com/android/tradefed/log/FileLogger.html#getLog())`() ` |\n| ` long` | ` `[getMaxLogSizeMbytes](../../../../../../reference/tradefed/com/android/tradefed/log/FileLogger.html#getMaxLogSizeMbytes())`() ` Returns the max log size of the log in MBytes. |\n| ` void` | ` `[init](../../../../../../reference/tradefed/com/android/tradefed/log/FileLogger.html#init())`() ` |\n\n| ### Protected methods ||\n|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[init](../../../../../../reference/tradefed/com/android/tradefed/log/FileLogger.html#init(java.lang.String,%20java.lang.String))`(String logPrefix, String fileSuffix) ` Alternative to [init()](../../../../../../reference/tradefed/com/android/tradefed/log/FileLogger.html#init()) where we can specify the file name and suffix. |\n\nPublic constructors\n-------------------\n\n### FileLogger\n\n```\npublic FileLogger ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### clone\n\n```\npublic ILeveledLogOutput clone ()\n```\n\nCreates a new [FileLogger](../../../../../../reference/tradefed/com/android/tradefed/log/FileLogger.html) with the same log level settings as the current object.\n\n\u003cbr /\u003e\n\nDoes not copy underlying log file content (ie the clone's log data will be written to a new file.)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------------------------------------------------------------------------------------------------------|--------|\n| [ILeveledLogOutput](../../../../../../reference/tradefed/com/android/tradefed/log/ILeveledLogOutput.html) | \u003cbr /\u003e |\n\n### closeLog\n\n```\npublic void closeLog ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### getLog\n\n```\npublic InputStreamSource getLog ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------|--------|\n| [InputStreamSource](../../../../../../reference/tradefed/com/android/tradefed/result/InputStreamSource.html) | \u003cbr /\u003e |\n\n### getMaxLogSizeMbytes\n\n```\npublic long getMaxLogSizeMbytes ()\n```\n\nReturns the max log size of the log in MBytes.\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------|--------|\n| `long` | \u003cbr /\u003e |\n\n### init\n\n```\npublic void init ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nProtected methods\n-----------------\n\n### init\n\n```\nprotected void init (String logPrefix, \n String fileSuffix)\n```\n\nAlternative to [init()](../../../../../../reference/tradefed/com/android/tradefed/log/FileLogger.html#init()) where we can specify the file name and suffix.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------|----------------------------------------------------------------|\n| `logPrefix` | `String`: the file name where to log without extension. \u003cbr /\u003e |\n| `fileSuffix` | `String`: the extension of the file where to log. \u003cbr /\u003e |"]]