Esempio n. 1
0
 /// <summary>
 ///		Get the name (for configuration) that corresponds to the specified Akka log level.
 /// </summary>
 /// <param name="logLevel">
 ///		The log level.
 /// </param>
 /// <returns>
 ///		The log level name.
 /// </returns>
 static string GetLogLevelName(LogLevel logLevel)
 {
     switch (logLevel)
     {
         case LogLevel.DebugLevel:
         {
             return "DEBUG";
         }
         case LogLevel.InfoLevel:
         {
             return "INFO";
         }
         case LogLevel.WarningLevel:
         {
             return "WARNING";
         }
         case LogLevel.ErrorLevel:
         {
             return "ERROR";
         }
         default:
         {
             throw new ArgumentOutOfRangeException(nameof(logLevel), logLevel, "Invalid log level.");
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        ///		Get the name (for configuration) that corresponds to the specified Akka log level.
        /// </summary>
        /// <param name="logLevel">
        ///		The log level.
        /// </param>
        /// <returns>
        ///		The log level name.
        /// </returns>
        static string GetLogLevelName(LogLevel logLevel)
        {
            switch (logLevel)
            {
            case LogLevel.DebugLevel:
            {
                return("DEBUG");
            }

            case LogLevel.InfoLevel:
            {
                return("INFO");
            }

            case LogLevel.WarningLevel:
            {
                return("WARNING");
            }

            case LogLevel.ErrorLevel:
            {
                return("ERROR");
            }

            default:
            {
                throw new ArgumentOutOfRangeException(nameof(logLevel), logLevel, "Invalid log level.");
            }
            }
        }
Esempio n. 3
0
        /// <summary>
        ///		Configuration with logging.
        /// </summary>
        public static Config Log(LogLevel logLevel = LogLevel.InfoLevel)
        {
            return ConfigurationFactory.ParseString(
                String.Format(@"
                    akka {{
                        loglevel = {0}

                        suppress-json-serializer-warning = on
                    }}
                ",
                GetLogLevelName(logLevel))
            );
        }
Esempio n. 4
0
        /// <summary>
        ///		Configuration with logging.
        /// </summary>
        public static Config Log(LogLevel logLevel = LogLevel.InfoLevel)
        {
            return(ConfigurationFactory.ParseString(
                       String.Format(@"
					akka {{
						loglevel = {0}

						suppress-json-serializer-warning = on
					}}
				"                ,
                                     GetLogLevelName(logLevel))
                       ));
        }