Skip to main content

class ChannelLogger

(Niantic.Lightship.Maps.Utilities.ChannelLogger)

Overview

Helper class that simplifies message logging for a specific log channel using the logging system in the Platform Debugging library. All messages logged with an instance of this class will be tagged with the channel name and given a unique color in the Unity Editor's console, which makes it easier to find log messages from a particular feature or system.

class ChannelLogger {
public:
// properties

string ChannelName;
LogLevel?? MaxLogLevel;

// methods

ChannelLogger(string logChannel, LogLevel maxLogLevel = LogLevel.Info);
void Fatal(string message);
void Error(string message);
void Warning(string message);
void Info(string message);
void Verbose(string message);
void LogTrace(string message);
void LogMessage(LogLevel logLevel, string message);
};

Detailed Documentation

Helper class that simplifies message logging for a specific log channel using the logging system in the Platform Debugging library. All messages logged with an instance of this class will be tagged with the channel name and given a unique color in the Unity Editor's console, which makes it easier to find log messages from a particular feature or system.

Properties

ChannelName

string ChannelName

The name of the channel associated with events logged from this class

MaxLogLevel

LogLevel?? MaxLogLevel

The max log level for this channel. Anything more verbose than this level will be suppressed. This can be used to suppress log messages if they're too verbose or to enable additional log messages while a system is being debugged.

Methods

ChannelLogger

ChannelLogger(string logChannel, LogLevel maxLogLevel = LogLevel.Info)

Constructor

    Parameters:

    logChannel - The channel name associated with log messages from instances of this class

    maxLogLevel - The max log level for this channel

Fatal

void Fatal(string message)

Log a LogLevel.Fatal message to the log channel

Error

void Error(string message)

Log an LogLevel.Error message to the log channel

Warning

void Warning(string message)

Log a LogLevel.Warning message to the log channel

Info

void Info(string message)

Log an LogLevel.Info message to the log channel

Verbose

void Verbose(string message)

Log a LogLevel.Verbose message to the log channel

LogTrace

void LogTrace(string message)

Log a LogLevel.Trace message to the log channel

LogMessage

void LogMessage(LogLevel logLevel, string message)

Log a message to the log channel

    Parameters:

    logLevel - The message's severity

    message - The message to log