<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Логирование скрипта]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12439&amp;type=atom" />
	<updated>2017-02-13T23:22:00Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12439</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логирование скрипта]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=112415#p112415" />
			<content type="html"><![CDATA[<p>Вот так как-то:<br /></p><div class="codebox"><pre><code>ScriptPath := &quot;D:\MyScript.ahk&quot;  ; прописать полный путь к скрипту
LogPath := &quot;D:\ErrorLog.txt&quot;  ; прописать путь к лог-файлу

FileRead, script, % ScriptPath
FileAppend, % ExecScript(script), % LogPath

ExecScript(Script)  {
   shell := ComObjCreate(&quot;WScript.Shell&quot;)
   exec := shell.Exec(&quot;AutoHotkey.exe /ErrorStdOut *&quot;)
   exec.StdIn.Write(script)
   exec.StdIn.Close()
   return exec.StdErr.ReadAll()
}</code></pre></div><p>Но это только на случай, что ошибку генерирует интерпретатор скрипта. Если скрипт завершает система — сообщения не будет.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-02-13T23:22:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=112415#p112415</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логирование скрипта]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=112405#p112405" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> допустим, у меня вылетает ошибка в скрипте (беру пример с явы), и он эту ошибку записывает в лог файл.</p>]]></content>
			<author>
				<name><![CDATA[Drizzy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34603</uri>
			</author>
			<updated>2017-02-13T21:26:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=112405#p112405</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логирование скрипта]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=112403#p112403" />
			<content type="html"><![CDATA[<p>А что вы понимаете под выражением «поставить логер на скрипт»?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-02-13T21:18:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=112403#p112403</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Логирование скрипта]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=112394#p112394" />
			<content type="html"><![CDATA[<p>Добрый день, подскажите пожалуйста как поставить логер на скрипт? У меня есть скрипт в районе 2к строк, и спустя 5-6 часов он выключается (ошибка приложения). Хочу поставить логер на скрипт и узнать в каком моменте он выключается. Думаю 2к строк кода сюда выкладывать бесмысленно, их просматривать никто не будет.</p>]]></content>
			<author>
				<name><![CDATA[Drizzy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34603</uri>
			</author>
			<updated>2017-02-13T20:50:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=112394#p112394</id>
		</entry>
</feed>
