프로젝트

일반

사용자정보

개정판 f7e7a61a

IDf7e7a61aadb73c131f88cf4dcf9a7a1a493ae044
상위 72718559
하위 122914ba

이지연이(가) 5년 이상 전에 추가함

issue #000: Markus Client Log FilePath 수정

Change-Id: I7b5d8115e72f03554a2441beb5b2bdffc7b2de13

차이점 보기:

KCOM/App.xaml.cs
230 230
                        splash.Close(new TimeSpan(0, 0, 2));
231 231
                    }
232 232
                }
233
                else
234
                {
235
                    splash.Close(new TimeSpan(0, 0, 2));
236
                }
237 233
            }
238 234
            catch (Exception ex)
239 235
            {
240 236
                MessageBox.Show("Err" + ex.Message);
241 237
            }
238
            finally
239
            {
240
                splash.Close(new TimeSpan(0, 0, 2));
241
            }
242 242
        }
243 243

  
244 244
        /// <summary>
......
291 291
        {
292 292
            try
293 293
            {
294
                string FilePath = "C:\\ProgramData\\MARKUS\\";
295
                //string pathString = AppDomain.CurrentDomain.BaseDirectory + "Err";
296
                string pathString = FilePath + "Err";
294
                string pathString = AppDataFolder + "\\Err";
297 295

  
298 296
                if (!File.Exists(pathString))
299 297
                {
......
307 305
            catch (Exception er)
308 306
            {
309 307
                string strError = er.ToString();
310
                //MessageBox.Show("err : " + er);
311 308
            }
312 309
        }
313 310
    }
KCOM/KCOM.csproj.user
5 5
    <ProjectView>ShowAllFiles</ProjectView>
6 6
  </PropertyGroup>
7 7
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
8
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjQwMDAwMTQwIiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOnRydWUsIk5ld0NvbW1lbnRQZXJtaXNzaW9uIjp0cnVlLCJQcm9qZWN0Tk8iOiIwMDAwMDAiLCJVc2VySUQiOiJIMjAwOTExNSIsIk1vZGUiOjB9</StartArguments>
8
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjQwMDAwMTQwIiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOnRydWUsIk5ld0NvbW1lbnRQZXJtaXNzaW9uIjp0cnVlLCJQcm9qZWN0Tk8iOiIwMDAwMDAiLCJVc2VySUQiOiJIMjAxMTM1NyIsIk1vZGUiOjB9</StartArguments>
9 9
  </PropertyGroup>
10 10
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
11 11
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjQwMDAwMDU3IiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOnRydWUsIk5ld0NvbW1lbnRQZXJtaXNzaW9uIjp0cnVlLCJQcm9qZWN0Tk8iOiIwMDAwMDAiLCJVc2VySUQiOiJIMjAxMTM1NyIsIk1vZGUiOjB9</StartArguments>
KCOM/Logger.cs
17 17
                int lv = global::KCOM.Properties.Settings.Default.loglevel;
18 18
                if (lv >= Loglevel) //세팅의 로그 레벨보다 낮거나 같으면 남김
19 19
                {
20
                    // string Msg = (string)text + " / " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\r\n";
21 20
                    string Msg = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\t" + "REQ" + "\t" + name + "(" + (string)text + ")" + "\r\n";
22
                    string Dir = "C:\\ProgramData\\MARKUS\\" + "Log";
21
                    string Dir = App.AppDataFolder + "\\Log";
23 22

  
24 23
                    if (Directory.Exists(Dir) == false)
25 24
                    {
......
45 44
                int lv = global::KCOM.Properties.Settings.Default.loglevel;
46 45
                if (lv >= Loglevel) //세팅의 로그 레벨보다 낮거나 같으면 남김
47 46
                {
48
                    // string Msg = (string)text + " / " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\r\n";
49 47
                    string Msg = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\t" + "RES" + "\t" + name + "(" + (string)text + ")" + "\r\n";
50
                    string Dir = "C:\\ProgramData\\MARKUS\\" + "Log";
48
                    string Dir = App.AppDataFolder + "\\Log";
51 49

  
52 50
                    if (Directory.Exists(Dir) == false)
53 51
                    {
......
73 71
                int lv = global::KCOM.Properties.Settings.Default.loglevel;
74 72
                if (lv >= Loglevel) //세팅의 로그 레벨보다 낮거나 같으면 남김
75 73
                {
76
                    // string Msg = (string)text + " / " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\r\n";
77 74
                    string Msg = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\t" + "RES" + "\t" + text + "\r\n";
78
                    string Dir = "C:\\ProgramData\\MARKUS\\" + "Check";
75
                    string Dir = App.AppDataFolder + "\\Check";
79 76

  
80 77
                    if (Directory.Exists(Dir) == false)
81 78
                    {
SmartUpdate/App.xaml.cs
2 2
using System.Collections.Generic;
3 3
using System.Configuration;
4 4
using System.Data;
5
using System.IO;
5 6
using System.Linq;
6 7
using System.Threading.Tasks;
7 8
using System.Windows;
......
13 14
    /// </summary>
14 15
    public partial class App : Application
15 16
    {
17
        /// <summary>
18
        /// Application Data Folder
19
        /// </summary>
20
        public static string AppDataFolder
21
        {
22
            get
23
            {
24
                return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MARKUS");
25
            }
26
        }
16 27
    }
17 28
}
SmartUpdate/MainWindow.xaml.cs
312 312
        {
313 313
            try
314 314
            {
315
                string pathString = "C:\\ProgramData\\MARKUS\\" + "UpdateLog\\Err";
315
                string pathString = App.AppDataFolder + "\\SmartUpdate";
316 316
                if (!File.Exists(pathString))
317 317
                {                    
318 318
                    Directory.CreateDirectory(pathString);
319 319
                }
320 320

  
321 321
                Err = Err + "   " +DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")  + "\r\n";
322
                string path = pathString + "\\" + "UpdateErrLog_" + DateTime.Now.ToString("yyyy-MM-dd hh-mm") + ".txt";
322
                string path = pathString + "\\" + "Log_" + DateTime.Now.ToString("yyyy-MM-dd hh-mm") + ".txt";
323 323
                File.AppendAllText(path, Err);
324 324
            }
325 325
            catch (Exception er)
326 326
            {
327 327
                string strError = er.ToString();
328
                //MessageBox.Show("err : " + er);
329 328
            }
330 329
        }
331 330
        private void LogFileWrite()
332 331
        {
333 332
            try
334 333
            {
335
                string pathString = "C:\\ProgramData\\MARKUS\\" + "UpdateLog";
334
                string pathString = App.AppDataFolder + "\\SmartUpdate";
336 335
                if (!File.Exists(pathString))
337 336
                {                    
338 337
                    Directory.CreateDirectory(pathString);
339 338
                }                   
340 339
                
341
                FileStream fs = new FileStream(pathString + "\\UpdateLog_" + DateTime.Now.ToString("yyyy-MM-dd hh-mm-ss") + ".txt", FileMode.OpenOrCreate, FileAccess.Write);
340
                FileStream fs = new FileStream(pathString + "\\Log_" + DateTime.Now.ToString("yyyy-MM-dd hh-mm-ss") + ".txt", FileMode.OpenOrCreate, FileAccess.Write);
342 341
                StreamWriter sw = new StreamWriter(fs);
343 342
                sw.WriteLine("<업그레이드 정보>");
344 343
                sw.WriteLine("<업데이트 날짜>");

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)