コード例 #1
0
        internal static void JSON <T>(T content, string fileName, string folderName)
        {
            LogData data = new LogData()
            {
                Message    = JsonConvert.SerializeObject(content),
                Path       = LogPaths.APILogPath,
                FileName   = string.Format("{0}_{1}.json", DateTime.Now.Ticks.ToString(), fileName),
                FolderName = folderName
            };

            FileQueueLogger.Instance().Enqueue(data);
        }
コード例 #2
0
        internal static void Error(Exception exception, string message, string fileName, string errorUrl, string folderName)
        {
            LogData data = new LogData()
            {
                Message  = ErrorFormat(exception, message, errorUrl),
                Path     = LogPaths.ErrorPath,
                FileName = string.IsNullOrEmpty(fileName)
                    ? string.Format("{0}_{1}", DateTime.Now.ToString("dd-mm-yyyy-HH-MM"), "ErrorLog.txt")
                    : fileName,
                FolderName = folderName
            };

            FileQueueLogger.Instance().Enqueue(data);
        }
コード例 #3
0
        internal static void Message(string title, string message, string fileName, string folderName)
        {
            fileName = string.IsNullOrEmpty(fileName)
                    ? string.Format("{0}_{1}", DateTime.Now.ToString("dd-mm-yyyy-HH-MM"), "InfoLog.txt")
                    : fileName;

            LogData data = new LogData()
            {
                Message    = title + message,
                Path       = LogPaths.InfoPath,
                FileName   = fileName,
                FolderName = folderName
            };

            FileQueueLogger.Instance().Enqueue(data);
        }