aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-02-28 11:35:06 +0100
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-02-28 11:35:06 +0100
commitb846fbcd7ccd61ac52d4299d199244dbbaafd258 (patch)
tree11a5349d97bc2c7f5a1e7ad0b2d5ca0e5d907a46
parentf22b551ec4232bc1ac4ec089fa60fe97c78d0b3c (diff)
downloadlog-b846fbcd7ccd61ac52d4299d199244dbbaafd258.tar.gz
log-b846fbcd7ccd61ac52d4299d199244dbbaafd258.zip
Add README.md
-rw-r--r--README.md40
1 files changed, 40 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0ca050b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,40 @@
+# Log library
+If you want to filter logs, you need to create a config file named:
+`log.config`. And put that in the same level as your application. For example,
+if your application is named `foo`, you have a directory structure such as:
+
+```
+$ ls -1
+foo
+log.config
+```
+
+Add properties in that file such as:
+```
+logging.level.<TAG>=<LEVEL>
+```
+`TAG` is a tag for the log created in your unit. So you can have multiple logs
+in a single file or share the same log in multiple files just using a tag name.
+
+You can control all logs using:
+```
+logging.level=<LEVEL>
+```
+
+## How to create a log
+Including file is `log.h`.
+
+```
+Log *log = log_create("A_TAG");
+```
+Or if you want to bind the log to the file:
+```
+Log *log = log_create(__FILE__);
+```
+Print logs with:
+```
+log_debug(log, "debug log");
+log_info(log, "info log");
+log_warn(log, "warning log");
+log_error(log, "error log");
+```