using System.Reflection;
using System.Windows.Forms;
using System.Runtime.Serialization;
+using System.IO;
namespace OpenTween
{
{
Assert.That(MyCommon.GetStatusUrl(screenName, statusId), Is.EqualTo(except));
}
+
+ [Test]
+ public void GetErrorLogPathTest()
+ {
+ var mockAssembly = Substitute.For<_Assembly>();
+ mockAssembly.Location.Returns(@"C:\hogehoge\OpenTween\OpenTween.exe");
+ MyCommon.EntryAssembly = mockAssembly;
+
+ Assert.That(MyCommon.GetErrorLogPath(), Is.SamePath(@"C:\hogehoge\OpenTween\ErrorLogs\"));
+ }
}
}
Block | Unblock | UserUpdate | Deleted | ListCreated | ListUpdated | Unfollow),
}
+ public static string GetErrorLogPath()
+ {
+ return Path.Combine(Path.GetDirectoryName(MyCommon.EntryAssembly.Location), "ErrorLogs");
+ }
+
public static void TraceOut(Exception ex, string Message)
{
var buf = ExceptionOutMessage(ex);
lock (LockObj)
{
if (!OutputFlag) return;
+
+ var logPath = MyCommon.GetErrorLogPath();
+ if (!Directory.Exists(logPath))
+ Directory.CreateDirectory(logPath);
+
var now = DateTime.Now;
var fileName = string.Format("{0}Trace-{1:0000}{2:00}{3:00}-{4:00}{5:00}{6:00}.log", GetAssemblyName(), now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second);
+ fileName = Path.Combine(logPath, fileName);
using (var writer = new StreamWriter(fileName))
{
lock (LockObj)
{
var IsTerminatePermission = true;
+
+ var logPath = MyCommon.GetErrorLogPath();
+ if (!Directory.Exists(logPath))
+ Directory.CreateDirectory(logPath);
+
var now = DateTime.Now;
var fileName = string.Format("{0}-{1:0000}{2:00}{3:00}-{4:00}{5:00}{6:00}.log", GetAssemblyName(), now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second);
+ fileName = Path.Combine(logPath, fileName);
using (var writer = new StreamWriter(fileName))
{
* NEW: タブの表示位置を画面上部に変更可能に (thx @aokomoriuta!)
* NEW: mobile.twitter.com/<スクリーン名>/status/<ステータスID> のURLも関連発言表示の対象に追加
* NEW: Favstarなどサードパーティ製サービスのパーマリンクURLも関連発言表示の対象に追加
+ * CHG: エラーログの出力先を変更 (OpenTween.exe と同じ場所に ErrorLogs フォルダが作成されます)
* FIX: スペースが含まれているURLをブラウザで開こうとするとURLが分断されて複数のタブが開いてしまう問題を修正 (thx @5px!)
* FIX: 画面更新時にInvalidOperationExceptionのエラーが発生する不具合を修正
* FIX: 関連発言表示が非公開アカウントのツイートに対して機能しない問題を修正