コード例 #1
0
        internal virtual void List(PrintStream @out, int indent)
        {
            int ngroupsSnapshot;

            ThreadGroup[] groupsSnapshot;
            lock (this)
            {
                for (int j = 0; j < indent; j++)
                {
                    @out.Print(" ");
                }
                @out.Println(this);
                indent += 4;
                for (int i = 0; i < Nthreads; i++)
                {
                    for (int j = 0; j < indent; j++)
                    {
                        @out.Print(" ");
                    }
                    @out.Println(Threads[i]);
                }
                ngroupsSnapshot = Ngroups;
                if (Groups != null)
                {
                    groupsSnapshot = Arrays.CopyOf(Groups, ngroupsSnapshot);
                }
                else
                {
                    groupsSnapshot = null;
                }
            }
            for (int i = 0; i < ngroupsSnapshot; i++)
            {
                groupsSnapshot[i].List(@out, indent);
            }
        }
コード例 #2
0
ファイル: LogUtil.cs プロジェクト: yulongjiang1997/app
        /**
         * Write.
         *
         * @param level the level
         * @param tag   the tag
         * @param msg   the msg
         * @param error the error
         */
        private static void write(string level, string tag, string msg, Throwable error)
        {
            if (!initialized)
            {
                init();
            }
            if (logStream == null || logStream.CheckError())
            {
                initialized = false;
                return;
            }

            Date now = new Date();

            logStream.Printf(LOG_ENTRY_FORMAT, now, now, level, tag, TAG_LEFT_BRICK
                             + TAG_RIGHT_BRICK + msg);
            logStream.Println();

            if (error != null)
            {
                error.PrintStackTrace(logStream);
                logStream.Println();
            }
        }
コード例 #3
0
        /// <summary>
        /// Returns a string representation of this message digest object.
        /// </summary>
        public override String ToString()
        {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            PrintStream           p    = new PrintStream(baos);

            p.Print(Algorithm_Renamed + " Message Digest from " + Provider_Renamed.Name + ", ");
            switch (State)
            {
            case INITIAL:
                p.Print("<initialized>");
                break;

            case IN_PROGRESS:
                p.Print("<in progress>");
                break;
            }
            p.Println();
            return(baos.ToString());
        }