diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-08-09 20:13:07 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@nvidia.com> | 2020-12-01 18:37:14 -0500 |
| commit | d473bdc7f1e65a37384acb29af568c4b12a5a207 (patch) | |
| tree | db53e564149e4b313a5954fb9d0465926959ca2f /lib/frrscript.h | |
| parent | cd6ca660c5e96f14f50b6a2f4f6f5cd83cb70d13 (diff) | |
lib: allow exporting all logging functions to Lua
Add a function that will export FRR's logging functions into a Lua
table, and add that table to the table of your choice (usually _ENV).
For instance, to add logging to the global environment:
lua_gettable(L, LUA_REGISTRYINDEX);
lua_gettable(L, LUA_RIDX_GLOBALS);
frrlua_export_logging(L);
Then the following functions are globally accessible to any Lua scripts
running with state L:
- log.debug()
- log.info()
- log.notice()
- log.warn()
- log.error()
These are bound to zlog_debug, zlog_info, etc. They only take one string
argument for now but this shouldn't be an issue given Lua's builtin
facilities for formatting strings.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/frrscript.h')
0 files changed, 0 insertions, 0 deletions
