This is my array:
local logEvents = {
[ "EMERGENCY" ] = colors.red,
[ "ALERT" ] = colors.red,
[ "CRITICAL" ] = colors.orange,
[ "ERROR" ] = colors.orange,
[ "WARNING" ] = colors.yellow,
[ "NOTICE" ] = colors.yellow,
[ "DEBUG" ] = colors.blue,
[ "INFORMATIONAL" ] = colors.lightBlue,
}
And then I check to see if the value is there (ex. emergency, alert, etc)
if logEvents[sev] ~= nil then
Here is the full code for my library:
local log = {}
local logFile = {}
local cache = require("IPv2/cache")
local os = require("os")
local component = require("component")
local col