summaryrefslogtreecommitdiff
path: root/cask/src/cask/util/Logger.scala
diff options
context:
space:
mode:
Diffstat (limited to 'cask/src/cask/util/Logger.scala')
-rw-r--r--cask/src/cask/util/Logger.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/cask/src/cask/util/Logger.scala b/cask/src/cask/util/Logger.scala
new file mode 100644
index 0000000..8dc3156
--- /dev/null
+++ b/cask/src/cask/util/Logger.scala
@@ -0,0 +1,18 @@
+package cask.util
+
+import sourcecode.{File, Line, Text}
+
+trait Logger {
+ def exception(t: Throwable): Unit
+
+ def debug(t: sourcecode.Text[Any])(implicit f: sourcecode.File, line: sourcecode.Line): Unit
+}
+object Logger{
+ class Console() extends Logger{
+ def exception(t: Throwable): Unit = t.printStackTrace()
+
+ def debug(t: Text[Any])(implicit f: File, line: Line): Unit = {
+ println(f.value.split('/').last + ":" + line + " " + t.source + " " + pprint.apply(t.value))
+ }
+ }
+} \ No newline at end of file