-
Notifications
You must be signed in to change notification settings - Fork 0
/
Logging.cs
103 lines (83 loc) · 3.23 KB
/
Logging.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Segy_Coord
{
internal class Logging
{
public static StringBuilder LoggingMessage = new StringBuilder();
public static StringBuilder LoggingError = new StringBuilder();
public static string FileOfLogs;
public static void SendOk()
{
LoggingMessage.Append(" - OK");
}
public static void SendCountOfNullValues(int countOfNull)
{
LoggingMessage.Append($" - {countOfNull} count of Null values\t");
}
public static void SendCountOfAddedEndPointsForNull(int countNullOfEnd)
{
LoggingMessage.Append($" - {countNullOfEnd} points added at the end (Null)\t");
}
public static void SendCountOfAddedStartPointsForNull(int countNullOfStart)
{
LoggingMessage.Append($" - {countNullOfStart} points added at the start (Null)\t");
}
public static void SendNoNullValues()
{
LoggingMessage.Append(" - no Null values\t");
}
public static void SendCountOfAddedEndTraces(int numberOfTracesInTheEndSegment)
{
LoggingMessage.Append($" - {numberOfTracesInTheEndSegment} traces can be included between last and previous traces\t");
}
public static void SendLastPointChanged()
{
LoggingMessage.Append(" - last point was changed (Distance)\t");
}
public static void SendCountOfAddedEndPointsForDistance(int shiftOnStart)
{
LoggingMessage.Append($" - {shiftOnStart + 1} points added at the end (Distance)\t");
}
public static void SendCountOfAddedStartPointsForDistance(int shiftOnStart)
{
LoggingMessage.Append($" - {shiftOnStart} points shifted forward at the start (Distance)\t");
}
public static void SendNoCornerPoints()
{
LoggingMessage.Append(" - No corner points\t");
}
public static void SendCountOfCornerPoints(int countOfCornerPoints)
{
LoggingMessage.Append($" - {countOfCornerPoints} corner points\t");
}
public static void SendLengthOfProfile(double lengthOfProfile)
{
LoggingMessage.Append($" - {lengthOfProfile} length of profile\t");
}
public static void SendDistanceOfTrace(double distanceOfTrace)
{
LoggingMessage.Append($" - {distanceOfTrace} distance between traces\t");
}
public static void SendNameOfLine(string NameOfLine)
{
LoggingMessage.Append(Path.GetFileNameWithoutExtension(NameOfLine) + "\t");
}
public static void SendNotEnoughTraces()
{
LoggingMessage.Append("!!!!!Number of traces not enough to use all corner points (may be too small distance between traces)!!!!!" + "\t");
}
public static void WriteLogToFile()
{
using (StreamWriter streamForLogFile = File.AppendText(FileOfLogs))
{
streamForLogFile.WriteLine(LoggingMessage.ToString());
}
LoggingMessage.Clear();
}
}
}