void send(LoggerSet logger, LogLevelSet logLevel, string message) { message = _defaultFormatter.FormatMessage(logger, logLevel, message); message = _timestampFormatter.FormatMessage(logger, logLevel, message); message = _colorFormatter.FormatMessage(logLevel, message); _socket.Send(logLevel, message); }
void Start() { if (catchUnityLogs) { _unityLog = LoggerFactory.GetLogger("Unity"); Application.logMessageReceived += onLog; // Application.logMessageReceivedThreaded += onLog; } }
void log(LoggerSet logger, LogLevelSet logLevel, string message) { //message = _defaultFormatter.FormatMessage(logger, logLevel, message); Debug.Log(message); if (logLevel <= LogLevelSet.Info) { Debug.Log(message); } else if (logLevel == LogLevelSet.Warn) { Debug.LogWarning(message); } else { Debug.LogError(message); } }
/// <summary> /// Removes a logger from the collection. /// </summary> /// <param name="logId">Id of the logger to remove.</param> public Result Remove(string logId) { try { if (string.IsNullOrEmpty(logId) || !LoggerSet.ContainsKey(logId)) { return(Result.SingleWarning(Warnings.LoggerDoesNotExist, logId)); } LoggerSet.Remove(logId); return(Result.Success); } catch (Exception e) { return(Result.Error(e)); } }
/// <summary> /// Adds a single logger to the collection. /// </summary> /// <param name="logger">Logger to add.</param> public Result Add(IResultLogger logger) { if (ReferenceEquals(logger, null)) { return(Result.SingleError(Errors.AddingNullLoggerToCollection)); } try { var key = logger.Id; if (LoggerSet.ContainsKey(key)) { return(Result.SingleWarning(Warnings.LoggerAlreadyExists, key)); } LoggerSet.Add(key, logger); return(Result.Success); } catch (Exception e) { return(Result.Error(e)); } }
void send(LoggerSet logger, LogLevelSet logLevel, string message) { _socket.Send(logLevel, message); }