예제 #1
0
            private IMethod GetTargetLoggerMethod(LogLevel logLevel, int argumentsCount, out bool createArgsArray)
            {
                LoggerMethods loggerMethods = this.parent.GetLoggerMethods(logLevel);

                createArgsArray = false;

                switch (argumentsCount)
                {
                case 0:
                    return(loggerMethods.WriteStringMethod);

                case 1:
                    return(loggerMethods.WriteStringFormat1Method);

                case 2:
                    return(loggerMethods.WriteStringFormat2Method);

                case 3:
                    return(loggerMethods.WriteStringFormat3Method);

                default:
                    createArgsArray = true;
                    return(loggerMethods.WriteStringFormatArrayMethod);
                }
            }
예제 #2
0
            public void EmitGetIsEnabled(InstructionWriter writer, LogLevel logLevel)
            {
                writer.EmitInstructionField(OpCodeNumber.Ldsfld, this.loggerField);
                LoggerMethods loggerMethods = this.parent.GetLoggerMethods(logLevel);

                writer.EmitInstructionMethod(OpCodeNumber.Callvirt, loggerMethods.IsLoggingEnabledMethod);
            }