< Summary

Information
Class: Ice.LoggerPlugin
Assembly: Ice
File(s): /home/runner/work/ice/ice/csharp/src/Ice/LoggerPlugin.cs
Tag: 71_18251537082
Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 54
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage
0%
Covered methods: 0
Total methods: 3
Method coverage: 0%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)0%2040%
initialize()100%210%
destroy()100%210%

File(s)

/home/runner/work/ice/ice/csharp/src/Ice/LoggerPlugin.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3namespace Ice;
 4
 5/// <summary>
 6/// Class to support custom loggers. Applications using a custom logger
 7/// instantiate a LoggerPlugin with a custom logger and
 8/// return the instance from their PluginFactory implementation.
 9/// </summary>
 10public class LoggerPlugin : Plugin
 11{
 12    /// <summary>
 13    /// Initializes a new instance of the <see cref="LoggerPlugin" /> class. This constructor installs a custom
 14    /// logger to the given communicator.
 15    /// </summary>
 16    /// <param name="communicator">The communicator using the custom logger.</param>
 17    /// <param name="logger">The custom logger for the communicator.</param>
 018    public
 019    LoggerPlugin(Communicator communicator, Logger logger)
 20    {
 021        if (communicator == null)
 22        {
 023            throw new PluginInitializationException("Communicator cannot be null.");
 24        }
 25
 026        if (logger == null)
 27        {
 028            throw new PluginInitializationException("Logger cannot be null.");
 29        }
 30
 031        Ice.Internal.Instance instance = communicator.instance;
 032        instance.setLogger(logger);
 033    }
 34
 35    /// <summary>
 36    /// Called by the Ice run time during communicator initialization. The derived class
 37    /// can override this method to perform any initialization that might be required
 38    /// by a custom logger.
 39    /// </summary>
 40    public void
 41    initialize()
 42    {
 043    }
 44
 45    /// <summary>
 46    /// Called by the Ice run time when the communicator is destroyed. The derived class
 47    /// can override this method to perform any finalization that might be required
 48    /// by a custom logger.
 49    /// </summary>
 50    public void
 51    destroy()
 52    {
 053    }
 54}