~grubng-dev/grubng/tools-urlsdb

« back to all changes in this revision

Viewing changes to Utils.cs

  • Committer: thindil
  • Date: 2011-04-15 09:42:05 UTC
  • Revision ID: thindil2@gmail.com-20110415094205-42balwonpi79oj3c
added function to write messages to file

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
                }
173
173
                
174
174
                /// <summary>
 
175
                /// Function write message to log files.
 
176
                /// </summary>
 
177
                /// <param name="message">
 
178
                /// A <see cref="System.String"/> message to write to log file.
 
179
                /// </param>
 
180
                public static void WriteLog(string message)
 
181
                {
 
182
                        string  date = DateTime.UtcNow.ToString("yyyy/MM/dd/HH:mm:ss");
 
183
                        using (System.IO.StreamWriter logstream = new System.IO.StreamWriter("error.log", true))
 
184
                        {
 
185
                                logstream.WriteLine(date + " " + message);
 
186
                                logstream.Close();
 
187
                        }
 
188
                }
 
189
                
 
190
                /// <summary>
175
191
                /// Function dispose unmanaged resources.
176
192
                /// </summary>
177
193
                public void Dispose()