Last active
December 3, 2015 18:23
-
-
Save moradology/9da7fc8a7bd7688ca0fe to your computer and use it in GitHub Desktop.
Poor man's log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io._ | |
def printToFile(fileNameString: String)(toWrite: Any) { | |
val fos = new FileOutputStream(new File(fileNameString), true) | |
val p = new java.io.PrintWriter(fos) | |
try { p.append(s"\n$toWrite") } finally { p.close() } | |
} | |
printToFile("test.txt")("TEST") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment