Photon Bolt Engine API  1.2.7
Classes | Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
BoltLog Class Reference

Provides logging capabilities to a variety of outputs More...

Classes

class  ConsoleWriter
 IWriter implementation that outputs to the Bolt console More...
 
class  File
 IWriter implementation that outputs to a file More...
 
interface  IWriter
 The interface providing log writing capabilities to an output More...
 
class  SystemOutWriter
 IWriter implementation that outputs to the system console out More...
 
class  UnityWriter
 IWriter implementation that outputs to Unity console More...
 

Static Public Member Functions

static void Add< T > (T instance)
 
static void Error (string message)
 
static void Error (object message)
 
static void Error (string message, object arg0)
 
static void Error (string message, object arg0, object arg1)
 
static void Error (string message, object arg0, object arg1, object arg2)
 
static void Error (string message, params object[] args)
 
static void Exception (Exception exception)
 
static void Info (string message)
 
static void Info (object message)
 
static void Info (string message, object arg0)
 
static void Info (string message, object arg0, object arg1)
 
static void Info (string message, object arg0, object arg1, object arg2)
 
static void Info (string message, params object[] args)
 
static void RemoveAll ()
 
static void Warn (string message)
 
static void Warn (object message)
 
static void Warn (string message, object arg0)
 
static void Warn (string message, object arg0, object arg1)
 
static void Warn (string message, object arg0, object arg1, object arg2)
 
static void Warn (string message, params object[] args)
 

Static Private Member Functions

static internal void Debug (string message)
 
static internal void Debug (object message)
 
static internal void Debug (string message, object arg0)
 
static internal void Debug (string message, object arg0, object arg1)
 
static internal void Debug (string message, object arg0, object arg1, object arg2)
 
static internal void Debug (string message, params object[] args)
 
static object [] FixNulls (object[] args)
 
static string Format (object message)
 
static string Format (string message, object arg0)
 
static string Format (string message, object arg0, object arg1)
 
static string Format (string message, object arg0, object arg1, object arg2)
 
static string Format (string message, object[] args)
 
static internal void Setup (BoltNetworkModes mode, BoltConfigLogTargets logTargets)
 

Static Private Attributes

static readonly object _lock = new object()
 
static List< IWriter_writers = new List<IWriter>()
 

Detailed Description

Provides logging capabilities to a variety of outputs

Example: Logging with different status levels.

void OwnerOnAttack(BoltEntity player, BoltEntity target) {
if(!target.isAttached) {
BoltLog.Error("Attempting to target an entity that is not attached: {0}", target.networkId);
}
else {
BoltLog.Info("{0} attack on {1}", player.networkId, target.networkId);
var playerState = player.GetState<PlayerState>();
var targetState = target.GetState<PlayerState>();
using (var mod = targetState.Modify()) {
mod.HP -= playerState.BaseDamage * playerState.DamageModMultiplier;
}
}
}

Member Function Documentation

◆ Add< T >()

static void BoltLog.Add< T > ( instance)
inlinestatic
Type Constraints
T :class 
T :IWriter 

◆ Debug() [1/6]

static internal void BoltLog.Debug ( string  message)
inlinestaticprivate

◆ Debug() [2/6]

static internal void BoltLog.Debug ( object  message)
inlinestaticprivate

◆ Debug() [3/6]

static internal void BoltLog.Debug ( string  message,
object  arg0 
)
inlinestaticprivate

◆ Debug() [4/6]

static internal void BoltLog.Debug ( string  message,
object  arg0,
object  arg1 
)
inlinestaticprivate

◆ Debug() [5/6]

static internal void BoltLog.Debug ( string  message,
object  arg0,
object  arg1,
object  arg2 
)
inlinestaticprivate

◆ Debug() [6/6]

static internal void BoltLog.Debug ( string  message,
params object []  args 
)
inlinestaticprivate

◆ Error() [1/6]

static void BoltLog.Error ( string  message)
inlinestatic

◆ Error() [2/6]

static void BoltLog.Error ( object  message)
inlinestatic

◆ Error() [3/6]

static void BoltLog.Error ( string  message,
object  arg0 
)
inlinestatic

◆ Error() [4/6]

static void BoltLog.Error ( string  message,
object  arg0,
object  arg1 
)
inlinestatic

◆ Error() [5/6]

static void BoltLog.Error ( string  message,
object  arg0,
object  arg1,
object  arg2 
)
inlinestatic

◆ Error() [6/6]

static void BoltLog.Error ( string  message,
params object []  args 
)
inlinestatic

◆ Exception()

static void BoltLog.Exception ( Exception  exception)
inlinestatic

◆ FixNulls()

static object [] BoltLog.FixNulls ( object []  args)
inlinestaticprivate

◆ Format() [1/5]

static string BoltLog.Format ( object  message)
inlinestaticprivate

◆ Format() [2/5]

static string BoltLog.Format ( string  message,
object  arg0 
)
inlinestaticprivate

◆ Format() [3/5]

static string BoltLog.Format ( string  message,
object  arg0,
object  arg1 
)
inlinestaticprivate

◆ Format() [4/5]

static string BoltLog.Format ( string  message,
object  arg0,
object  arg1,
object  arg2 
)
inlinestaticprivate

◆ Format() [5/5]

static string BoltLog.Format ( string  message,
object []  args 
)
inlinestaticprivate

◆ Info() [1/6]

static void BoltLog.Info ( string  message)
inlinestatic

◆ Info() [2/6]

static void BoltLog.Info ( object  message)
inlinestatic

◆ Info() [3/6]

static void BoltLog.Info ( string  message,
object  arg0 
)
inlinestatic

◆ Info() [4/6]

static void BoltLog.Info ( string  message,
object  arg0,
object  arg1 
)
inlinestatic

◆ Info() [5/6]

static void BoltLog.Info ( string  message,
object  arg0,
object  arg1,
object  arg2 
)
inlinestatic

◆ Info() [6/6]

static void BoltLog.Info ( string  message,
params object []  args 
)
inlinestatic

◆ RemoveAll()

static void BoltLog.RemoveAll ( )
inlinestatic

◆ Setup()

static internal void BoltLog.Setup ( BoltNetworkModes  mode,
BoltConfigLogTargets  logTargets 
)
inlinestaticprivate

◆ Warn() [1/6]

static void BoltLog.Warn ( string  message)
inlinestatic

◆ Warn() [2/6]

static void BoltLog.Warn ( object  message)
inlinestatic

◆ Warn() [3/6]

static void BoltLog.Warn ( string  message,
object  arg0 
)
inlinestatic

◆ Warn() [4/6]

static void BoltLog.Warn ( string  message,
object  arg0,
object  arg1 
)
inlinestatic

◆ Warn() [5/6]

static void BoltLog.Warn ( string  message,
object  arg0,
object  arg1,
object  arg2 
)
inlinestatic

◆ Warn() [6/6]

static void BoltLog.Warn ( string  message,
params object []  args 
)
inlinestatic

Member Data Documentation

◆ _lock

readonly object BoltLog._lock = new object()
staticprivate

◆ _writers

List<IWriter> BoltLog._writers = new List<IWriter>()
staticprivate