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 ()
공개 메서드
closeLog
public void closeLog ()
getMaxLogSizeMbytes
public long getMaxLogSizeMbytes ()
로그의 최대 로그 크기를 MB 단위로 반환합니다.
보호된 메서드
init
protected void init (String logPrefix,
String fileSuffix)
파일 이름과 접미사를 지정할 수 있는 init()
의 대안입니다.
매개변수 |
logPrefix |
String : 확장자가 없는 로깅 파일 이름입니다. |
fileSuffix |
String : 로깅할 파일의 확장자입니다. |
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 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 |"]]