Logic Machine Forum
alert type - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: alert type (/showthread.php?tid=2918)



alert type - Frank68 - 21.10.2020

Hello

I was doing some tests to check if it was possible in the alert manager to have 2 types of alerts, one with acoustic "ALARM" and one without "WARNING" maybe in a different color, so that I can differentiate the messages generated by scripts, or if you can suggest me a way to be able to see both logs in visu.

thank you so much


RE: alert type - admin - 23.10.2020

You can store other events separately. See this example: https://forum.logicmachine.net/showthread.php?tid=350&pid=1726#pid1726


RE: alert type - Frank68 - 23.10.2020

(23.10.2020, 12:38)admin Wrote: You can store other events separately. See this example: https://forum.logicmachine.net/showthread.php?tid=350&pid=1726#pid1726

Perfect I have make all and run , if i wan't change font dimension and color is possible apply a css style in this page ?


RE: alert type - admin - 23.10.2020

Add style tag before closing head tag. You can add any CSS inside of the style tag.
Code:
<style>
h3 { color: red; }
p { font-weight: bold; }
</style>
</head>



RE: alert type - Frank68 - 26.10.2020

(23.10.2020, 14:49)admin Wrote: Add style tag before closing head tag. You can add any CSS inside of the style tag.
Code:
<style>
h3 { color: red; }
p { font-weight: bold; }
</style>
</head>
Hi

Tank's for all

but now I see the day in log file is English , nut i have set all in italian language , is possible have the day in Italian ?


RE: alert type - admin - 27.10.2020

Change eventlog function to replace day names. Keep in mind that this will only work for newly events after the function has been modified.
Code:
function eventlog(text)
  local max = 1000 -- max number of entries

  -- add formatted date
  local date = os.date('%a %d/%m/%Y %T ')

  date = date:gsub('%a+', {
    Mon = 'lun.',
    Tue = 'mar.',
    Wed = 'mer.',
    Thu = 'gio.',
    Fri = 'ven.',
    Sat = 'sab.',
    Sun = 'dom.',
  })

  storage.exec('lpush', 'eventlog', date .. text)
  storage.exec('ltrim', 'eventlog', 0, max - 1)
end