실행 로그
Google Ads 스크립트는 변경 로그와 로그 출력이라는 두 가지 유형의 실행 로그를 표시하며, 이는 미리보기 모드와 실제 실행에서 모두 가능합니다.
- 변경 로그
변경 로그에는 스크립트에서 수행한 Google Ads 항목에 대한 모든 변경사항(항목 설명, 변경 유형, 이전 및 이후 값, 오류(있는 경우))이 표시됩니다.
변경 로그는 오류 메시지만 표시하도록 필터링할 수 있습니다
- 로그 출력
스크립트에서 console.log("Hello world!");
를 실행하면 'Hello world!'가 로그에 표시됩니다. 텍스트 비트를 로깅하는 것은 디버깅 중에 특히 유용하지만 실행 중에도 종종 유용합니다.
다음 스크립트를 매일 실행하도록 예약했다고 가정해 봅시다.
let spreadsheet = SpreadsheetApp.create("Daily Report");
// Populate the spreadsheet.
// ...
console.log("Daily report ready!");
console.log(spreadsheet.getUrl());
스크립트는 매 실행마다 새로 생성된 스프레드시트의 URL을 로깅하여 나중에 더 쉽게 찾을 수 있도록 합니다. console.warn()
또는 console.error()
를 사용하여 로그에 주황색 또는 빨간색 텍스트를 기록할 수도 있습니다.
프로그래머가 지정한 로그 메시지 외에도 실행 중에 Google Ads 스크립트에서 발생한 오류 및 경고도 텍스트 로그에 표시됩니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-11-05(UTC)
[null,null,["최종 업데이트: 2024-11-05(UTC)"],[[["Google Ads scripts provide two types of execution logs: Changes logs (tracking entity modifications) and Logs output (displaying script messages)."],["Changes logs detail all alterations made by the script to Google Ads entities, including before and after values, and can be filtered to show only errors."],["Logs output displays messages generated by the script using `console.log`, `console.warn`, and `console.error`, useful for debugging and providing context during live executions."],["Errors and warnings encountered by scripts during execution are automatically included in the text logs for troubleshooting."]]],[]]