WoW API: LoggingCombat

WoW API < LoggingCombat


Toggles logging for the combat log and returns the current state.

isLogging = LoggingCombat([newState])


ParametersEdit

ArgumentsEdit

newState
Boolean - toggles combat logging

ReturnsEdit

isLogging
Boolean - current state of logging


ExampleEdit

if (LoggingCombat()) then
  DEFAULT_CHAT_FRAME:AddMessage("Combat is already being logged");
else
  DEFAULT_CHAT_FRAME:AddMessage("Combat is not being logged - starting it!");  
  LoggingCombat(1);
end

Example #2Edit

Create a new macro and paste the following (one-line)

/script a=LoggingCombat(LoggingCombat()==nil); UIErrorsFrame:AddMessage("CombatLogging is now "..tostring(a and "ON" or "OFF"),1,0,0);

Drag the macro-button to an action bar or key bind it
and you have a one-click/keypress toggle.

DetailsEdit

If no parameter is passed in, LoggingCombat turns logging on.