از 27 مارس 2025، توصیه می کنیم از android-latest-release
به جای aosp-main
برای ساختن و کمک به AOSP استفاده کنید. برای اطلاعات بیشتر، به تغییرات AOSP مراجعه کنید.
فایل های گزارش را از یک گزارشگر نتیجه مدیریت کنید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
در برخی موارد، دسترسی به تنها نتایج آزمون کافی نیست. داشتن فایل های گزارش برای تکمیل نتایج کلی ضروری است.
رابط ورود به سیستم
هر گزارشگر نتیجه یا رویداد آزمایشی میتواند با پیادهسازی ILogSaverListener
به گزارشها دسترسی داشته باشد، که به گزارشگر اجازه میدهد گزارشها را از طریق تماسهای مختلف دریافت کند:
-
testLogSaved
: بلافاصله هنگامی که یک فایل ثبت می شود، فراخوانی می شود. این نشان می دهد که یک فایل جدید ثبت شده است. این در هر زمان نامیده می شود. -
logAssociation
: به ترتیب با رویدادهای آزمایشی فراخوانی می شود. این امر ارتباط قوی بین فایل ثبت شده و رویدادهای در حال انجام را تضمین می کند.
با پیاده سازی این رابط، گزارشگر نتیجه می تواند به منابع فایل لاگ شده دسترسی داشته باشد و از آنها استفاده کند.
زمان استفاده از logAssociation
logAssociation
یک رویداد کمی پیچیدهتر است زیرا بر زمینه رویدادها برای تفسیر مناسب تکیه دارد. به عنوان مثال، اگر testStart
فراخوانی شده باشد، گزارش از logAssociation
متعلق به آزمایش در حال انجام است.
این ارتباط قوی امکان قرارگیری صحیح سیاههها را فراهم می کند.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Handle log files from a result reporter\n\nIn some cases, having access to only the test results isn't enough; having\nthe log files is necessary to complete the overall results.\n\nLog interface\n-------------\n\nAny result reporter or [test event](/docs/core/tests/tradefed/architecture/result-reporter#core_interface)\ncan have access to the logs by implementing\n[`ILogSaverListener`](https://android.googlesource.com/platform/tools/tradefederation/+/refs/heads/android16-release/invocation_interfaces/com/android/tradefed/result/ILogSaverListener.java),\nwhich lets a reporter receive the logs through different callbacks:\n\n- `testLogSaved`: Called right away when a file is logged. This notifies a new file has been logged. This is called at any time.\n- `logAssociation`: Called in order with the test events. This ensures a strong association between the file being logged and the events in progress.\n\nBy implementing this interface, the result reporter can have access to the\nlogged file references and use them.\n\nWhen to use logAssociation\n--------------------------\n\n`logAssociation` is a slightly more complicated event as it relies on the\ncontext of the events to be properly interpreted. For example, if the\n`testStart` has been called, the log from `logAssociation` belongs to the test\ncase in progress.\n\nThis strong association allows for correct placement of logs."]]