Example #1
0
 public void logString(string str, bool write_console = true)
 {
     //str = string.Format("[{0}]#\n{1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), str);
     SBUtils.logString(this.LogFile, str);
     if (write_console)
     {
         Console.WriteLine(string.Format("[{0}]#\n{1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), str));
     }
 }
Example #2
0
        public static void log(string file, object text)
        {
            StreamWriter log;

            if (!File.Exists(file))
            {
                log = new StreamWriter(file);
            }
            else
            {
                log = File.AppendText(file);
            }

            // Write to the file:
            log.WriteLine(SBUtils.var_dump(text, 0));
            log.WriteLine();

            // Close the stream:
            log.Close();
        }
Example #3
0
        /// <summary>
        /// Returns the first day of the week that the specified
        /// date is in using the current culture.
        /// </summary>
        public static DateTime GetFirstDayOfWeek(DateTime dayInWeek)
        {
            CultureInfo defaultCultureInfo = CultureInfo.CurrentCulture;

            return(SBUtils.GetFirstDayOfWeek(dayInWeek, defaultCultureInfo));
        }
Example #4
0
 public void log(object obj)
 {
     SBUtils.log(this.LogFile, obj);
 }