aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2022-04-24 21:50:24 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2022-04-24 21:50:24 +0200
commit750b25871dae2ff69ca35c3c8d83ba548b8ac5fb (patch)
tree502575862979cf226ed3606f9cd7f3331304aa80
parentbde0650600ca4390978f4904e32a823c75360a0f (diff)
Explain how to write to files
-rw-r--r--README.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/README.md b/README.md
index c0c519f..ef43765 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,14 @@
# clog
Simple logging library for C
+
+If you want to save the logs to a file you can use `tee`:
+```
+someprogram | tee logfile.txt
+```
+
+The `-a` command line switch makes tee append to the file
+rather than truncating in overwriting it:
+```
+echo -e "\n---------\nSEPERATOR\n---------\n" >> logfile.txt
+someprogram | tee -a logfile.txt
+```