WoW:API LoggingChat: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
m (Move page script moved page API LoggingChat to API LoggingChat without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{WoW API}}
{{wowapi}} __NOTOC__


isLogging = LoggingChat([newState])


(Returns new state (or current state if no argument))
<!-- Describe the purpose of the function, exhausting detail can be saved for a later section -->
Toggles the chat logging and returns the current state.


returns NIL if logging currently is disabled, and 1 (one) if logging is enabled
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
isLogging = LoggingChat([newState])


added in patch 1.7.0


Codesnippet:
== Parameters ==
=== Arguments ===
<!-- List each argument, together with its type -->


:;newState : Boolean - toggles chat logging
=== Returns ===
<!-- List each return value, together with its type -->
:;isLogging : Boolean - current state of logging
== Example ==
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->
  if (LoggingChat()) then
  if (LoggingChat()) then
   DEFAULT_CHAT_FRAME:AddMessage("chatlog IS running",1,0,0);
   DEFAULT_CHAT_FRAME:AddMessage("Chat is already being logged");
  else
  else
   DEFAULT_CHAT_FRAME:AddMessage("chatlog IS NOT running... starting");   
   DEFAULT_CHAT_FRAME:AddMessage("Chat is not being logged - starting it!");   
   LoggingChat(1);
   LoggingChat(1);
   DEFAULT_CHAT_FRAME:AddMessage("Chat beeing logged to logs\\WOWChatLog.txt");
   DEFAULT_CHAT_FRAME:AddMessage("Chat is now being logged to Logs\\WOWChatLog.txt");
  end
  end
 
 
--[[User:Agge|Agge]] 11:11, 31 Jan 2006 (EST)

Latest revision as of 04:46, 15 August 2023

WoW API < LoggingChat


Toggles the chat logging and returns the current state.

isLogging = LoggingChat([newState])


Parameters[edit]

Arguments[edit]

newState
Boolean - toggles chat logging

Returns[edit]

isLogging
Boolean - current state of logging


Example[edit]

if (LoggingChat()) then
  DEFAULT_CHAT_FRAME:AddMessage("Chat is already being logged");
else
  DEFAULT_CHAT_FRAME:AddMessage("Chat is not being logged - starting it!");  
  LoggingChat(1);
  DEFAULT_CHAT_FRAME:AddMessage("Chat is now being logged to Logs\\WOWChatLog.txt");
end