diff options
author | terminaldweller <devi@terminaldweller.com> | 2023-03-19 10:58:15 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2023-03-19 10:58:15 +0000 |
commit | 7396f80d1a244273c83aee4a750b3fc1eb842e5d (patch) | |
tree | bd00438882f95f7fc233f95910ae950390650faf | |
parent | now using proper string replacement (diff) | |
download | lclip-sqlite3.tar.gz lclip-sqlite3.zip |
added function names to the logssqlite3
-rwxr-xr-x | lclipd.lua | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -110,11 +110,14 @@ parser:option("-s --hist_size", "history file size", 200) --- Log the given string to syslog with the given priority. -- @param log_str the string passed to the logging facility -- @param log_priority the priority of the log string +-- functions called through pcall will return nil when we +-- try to get their name from debug.getinfo local function log_to_syslog(log_str, log_priority) + local caller_name = debug.getinfo(2, "n").name posix_syslog.openlog("clipd", posix_syslog.LOG_NDELAY | posix_syslog.LOG_PID, posix_syslog.LOG_LOCAL0) - posix_syslog.syslog(log_priority, log_str) + posix_syslog.syslog(log_priority, tostring(caller_name) .. ": " .. log_str) posix_syslog.closelog() end |