SharpCifs.Util.LogStream.SetLevel C# (CSharp) Method

SetLevel() public method

public SetLevel ( int level ) : void
level int
return void
		public void SetLevel(int level)
		{
			this.Level = level;
		}

Usage Example

Example #1
0
        static Config()
        {
            int level;
            FileInputStream fis = null;
            _log = LogStream.GetInstance();

            try
            {
                string filename = Runtime.GetProperty("jcifs.properties");
                if (filename != null && filename.Length > 1)
                {
                    fis = new FileInputStream(filename);
                }
                Load(fis);
                if (fis != null)
                {
                    fis.Close();
                }
            }
            catch (IOException ioe)
            {
                if (_log.Level > 0)
                {
                    Runtime.PrintStackTrace(ioe, _log);
                }
            }

            if ((level = GetInt("jcifs.util.loglevel", -1)) != -1)
            {
                _log.SetLevel(level);
            }

            try
            {
                Runtime.GetBytesForString(string.Empty, DefaultOemEncoding);
            }
            catch (Exception ex)
            {
                if (_log.Level >= 2)
                {
                    _log.WriteLine("WARNING: The default OEM encoding " + DefaultOemEncoding + " does not appear to be supported by this JRE. The default encoding will be US-ASCII."
                        );
                }

                //DEFAULT_OEM_ENCODING = "US-ASCII";
            }

            if (_log.Level >= 4)
            {
                try
                {
                    _prp.Store(_log);
                }
                catch (IOException)
                {
                }
            }
        }