0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-12-22 11:03:48 +01:00

loglite readme additions like installation

This commit is contained in:
peteruithoven 2016-03-16 17:36:41 +01:00
parent f06e3da46b
commit 4db83c98c5
2 changed files with 27 additions and 6 deletions

View File

@ -65,3 +65,24 @@ The following directives can be associated with a pattern:
* `_delete` or `_nodelete` to override the active mode specified in the 'options' above. * `_delete` or `_nodelete` to override the active mode specified in the 'options' above.
Directives can be combined with ',' (e.g.: `'red,_nodelete'`). Finally, in any filter set, pattern rules are matched from top to bottom, the last one encountered overriding any previous conflicting directive. Directives can be combined with ',' (e.g.: `'red,_nodelete'`). Finally, in any filter set, pattern rules are matched from top to bottom, the last one encountered overriding any previous conflicting directive.
### Installation
Note: Loglite is already installed on the WiFi-Box since version 0.10.10.
Install Lua. See:
http://lua-users.org/wiki/LuaBinaries
It's tested in Lua 5.1 and Lua 5.2.
Loglite will check for a `loglite-filters.lua` file in your home directory. It's recommended to create a symbolic link to the latest version.
On OS X / Linux:
```
cd
ln -s [absolute path to file]/loglite-filters.lua loglite-filters.lua
```
It's recommended to create a symbolic link in one of your PATH directories (`echo $PATH`) to the loglite.lua file. This allows you to run `loglite` from any directory.
On OS X / Linux:
```
cd /usr/local/bin
ln -s [absolute path to file]/loglite.lua loglite.lua
```

View File

@ -158,7 +158,7 @@ local function tailStream(stream, filterSet)
-- look for a pattern matching this line -- look for a pattern matching this line
for p,c in pairs(patterns) do for p,c in pairs(patterns) do
if line:match(p) then if line:match(p) then
--print("[DEBUG] +matched rule '" .. p .. "'/'" .. c .. "' against '" .. line .. "'") -- print("[DEBUG] +matched rule '" .. p .. "'/'" .. c .. "' against '" .. line .. "'")
local kws = c:split(',') local kws = c:split(',')
if hasValue(kws, '_delete') then keepLine = false; keepLineOverridden = true if hasValue(kws, '_delete') then keepLine = false; keepLineOverridden = true
@ -193,7 +193,7 @@ local function tailStream(stream, filterSet)
if options.count == 'all' then print(c, embellished) if options.count == 'all' then print(c, embellished)
else print(embellished) end else print(embellished) end
else else
--print("[DEBUG] -skipped '"..line.."'") -- print("[DEBUG] -skipped '"..line.."'")
end end
--c = line:match 'truncated' and 0 or c -- from tail on stderr apparently --c = line:match 'truncated' and 0 or c -- from tail on stderr apparently
@ -246,7 +246,7 @@ local function main()
-- read filter set file if available -- read filter set file if available
local configSets = readConfigFile(DFL_FILTERSET_FILE, os.getenv('HOME')) or {} local configSets = readConfigFile(DFL_FILTERSET_FILE, os.getenv('HOME')) or {}
local filterSet = readFilterSet(configSets, filterSetName) local filterSet = readFilterSet(configSets, filterSetName)
--print("[DEBUG] final filter set for '" .. filterSetName .. "' from config: " .. dump(filterSet)) -- print("[DEBUG] final filter set for '" .. filterSetName .. "' from config: " .. dump(filterSet))
-- if requested, display help and exit -- if requested, display help and exit
if showHelp and showHelp == true then if showHelp and showHelp == true then