"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[1008],{8453:(e,n,r)=>{r.d(n,{R:()=>l,x:()=>i});var s=r(6540);const o={},t=s.createContext(o);function l(e){const n=s.useContext(t);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),s.createElement(t.Provider,{value:n},e.children)}},9849:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>a,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"XXTLanControl.lua/core/log","title":"Send Controller Logs (LCC.log)","description":"Signature","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/core/log.md","sourceDirName":"XXTLanControl.lua/core","slug":"/XXTLanControl.lua/core/log","permalink":"/docs/en/XXTLanControl.lua/core/log","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":60,"frontMatter":{"sidebar_position":60},"sidebar":"tutorialSidebar","previous":{"title":"Read Script UI Configuration (LCC.get_ui_config)","permalink":"/docs/en/XXTLanControl.lua/core/get_ui_config"},"next":{"title":"Shared Files","permalink":"/docs/en/XXTLanControl.lua/web-file/"}}');var o=r(4848),t=r(8453);const l={sidebar_position:60},i="Send Controller Logs (LCC.log)",a={},c=[{value:"Signature",id:"signature",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Returns",id:"returns",level:2},{value:"Notes",id:"notes",level:2},{value:"Example",id:"example",level:2}];function d(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"send-controller-logs-lcclog",children:"Send Controller Logs (LCC.log)"})}),"\n",(0,o.jsx)(n.h2,{id:"signature",children:"Signature"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-lua",children:"LCC.log(id, ...)\nLCC.log(log_map)\n"})}),"\n",(0,o.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["id",(0,o.jsx)(n.br,{}),"\n","Integer from 1 to 6, pointing to one of the controller's six log channels."]}),"\n",(0,o.jsxs)(n.li,{children:["...",(0,o.jsx)(n.br,{}),"\n","Variadic arguments. Strings or tables; tables are serialised with ",(0,o.jsx)(n.code,{children:"table.deep_dump"}),", strings can embed ",(0,o.jsx)(n.code,{children:"[DATE]"})," and ",(0,o.jsx)(n.code,{children:"[LINE]"})," placeholders."]}),"\n",(0,o.jsxs)(n.li,{children:["log_map",(0,o.jsx)(n.br,{}),"\n","Table whose keys match the aliases defined via ",(0,o.jsx)(n.code,{children:"set_log_aliases"}),"; values can be strings or tables."]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"returns",children:"Returns"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"none"}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsxs)(n.p,{children:["Validates that a controller address has been configured, otherwise raises an error.",(0,o.jsx)(n.br,{}),"\n","Retries on network issues until the log is delivered; during retries a ",(0,o.jsx)(n.code,{children:"sys.toast"})," notification is shown.",(0,o.jsx)(n.br,{}),"\n","When using the alias map form, only keys that match an alias are sent, routed to the corresponding channel number."]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-lua",children:'LCC.log(1, "[DATE] sync starting", { count = 128 })\n\nLCC.log({\n    ["Status"] = "Sync complete",\n    ["Error"] = "0"\n})\n'})})]})}function u(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}}}]);