diff options
author | Kangho Hur <kangho.hur@samsung.com> | 2016-12-16 11:00:07 +0900 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-10-23 13:34:24 +0900 |
commit | a2e67107402bc5a49d73cee9062bcd7dbe4069e7 (patch) | |
tree | ea6c6606567e8440397de192d47195194c0266dd /Xamarin.Forms.Platform.Tizen/Log/ConsoleLogger.cs | |
parent | 509954d0a013acdf7508644c1fb394bea626e587 (diff) | |
download | xamarin-forms-a2e67107402bc5a49d73cee9062bcd7dbe4069e7.tar.gz xamarin-forms-a2e67107402bc5a49d73cee9062bcd7dbe4069e7.tar.bz2 xamarin-forms-a2e67107402bc5a49d73cee9062bcd7dbe4069e7.zip |
Add Tizen backend renderer
- Xamarin.Forms.Platform.Tizen has been added
- Xamarin.Forms.Maps.Tizen has been added
- RPM build spec has been added
Change-Id: I0021e0f040d97345affc87512ee0f6ce437f4e6d
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Log/ConsoleLogger.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Log/ConsoleLogger.cs | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Log/ConsoleLogger.cs b/Xamarin.Forms.Platform.Tizen/Log/ConsoleLogger.cs new file mode 100644 index 00000000..19e46e9e --- /dev/null +++ b/Xamarin.Forms.Platform.Tizen/Log/ConsoleLogger.cs @@ -0,0 +1,68 @@ +using System; +using System.IO; + +namespace Xamarin.Forms.Platform.Tizen +{ + /// <summary> + /// Logs a message to the console. + /// </summary> + internal class ConsoleLogger : ILogger + { + public void Debug(string tag, string message, string file, string func, int line) + { + Print("D", tag, message, file, func, line); + } + + public void Verbose(string tag, string message, string file, string func, int line) + { + Print("V", tag, message, file, func, line); + } + + public void Info(string tag, string message, string file, string func, int line) + { + Print("I", tag, message, file, func, line); + } + + public void Warn(string tag, string message, string file, string func, int line) + { + Print("W", tag, message, file, func, line); + } + + public void Error(string tag, string message, string file, string func, int line) + { + Print("E", tag, message, file, func, line); + } + + public void Fatal(string tag, string message, string file, string func, int line) + { + Print("F", tag, message, file, func, line); + } + + /// <summary> + /// Formats and prints the log information. + /// </summary> + /// <param name="level">Log level</param> + /// <param name="tag">Log tag</param> + /// <param name="message">Log message</param> + /// <param name="file">Full path to the file</param> + /// <param name="func">Function name</param> + /// <param name="line">Line number</param> + void Print(string level, string tag, string message, string file, string func, int line) + { + Uri f = new Uri(file); + Console.WriteLine( + String.Format( + "\n[{6:yyyy-MM-dd HH:mm:ss.ffff} {0}/{1}]\n{2}: {3}({4}) > {5}", + level, // 0 + tag, // 1 + Path.GetFileName(f.AbsolutePath), // 2 + func, // 3 + line, // 4 + message, // 5 + DateTime.Now // 6 + ) + ); + } + } +} + |