Mercurial > hg > graal-compiler
annotate graal/com.oracle.jvmci.debug/src/com/oracle/jvmci/debug/Indent.java @ 21709:3c17c0c41a6b
moved com.oracle.asm.**.test to JVMCI namespace (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 03 Jun 2015 18:33:23 +0200 |
parents | b1530a6cce8c |
children |
rev | line source |
---|---|
11382
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
1 /* |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
4 * |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
8 * |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
14 * |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
18 * |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
21 * questions. |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
22 */ |
21554
b1530a6cce8c
renamed com.oracle.graal.[debug|options|hotspotvmconfig]* modules to com.oracle.jvmci.[debug|options|hotspotvmconfig]* modules (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
14871
diff
changeset
|
23 package com.oracle.jvmci.debug; |
11382
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
24 |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
25 /** |
14871
667710021ea1
removed methods in Indent that are redundant with those in Debug
Doug Simon <doug.simon@oracle.com>
parents:
13551
diff
changeset
|
26 * Object used to close a debug {@link Debug#indent() indentation} scope. |
11382
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
27 * <p> |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
28 * Example usage: |
14871
667710021ea1
removed methods in Indent that are redundant with those in Debug
Doug Simon <doug.simon@oracle.com>
parents:
13551
diff
changeset
|
29 * |
11382
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
30 * <pre> |
14871
667710021ea1
removed methods in Indent that are redundant with those in Debug
Doug Simon <doug.simon@oracle.com>
parents:
13551
diff
changeset
|
31 * |
667710021ea1
removed methods in Indent that are redundant with those in Debug
Doug Simon <doug.simon@oracle.com>
parents:
13551
diff
changeset
|
32 * try (Indent i1 = Debug.logAndIndent("header message")) { |
11382
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
33 * ... |
14871
667710021ea1
removed methods in Indent that are redundant with those in Debug
Doug Simon <doug.simon@oracle.com>
parents:
13551
diff
changeset
|
34 * Debug.log("message"); |
11382
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
35 * ... |
14871
667710021ea1
removed methods in Indent that are redundant with those in Debug
Doug Simon <doug.simon@oracle.com>
parents:
13551
diff
changeset
|
36 * try (Indent i2 = Debug.logAndIndent(sub-header message")) { |
667710021ea1
removed methods in Indent that are redundant with those in Debug
Doug Simon <doug.simon@oracle.com>
parents:
13551
diff
changeset
|
37 * ... |
667710021ea1
removed methods in Indent that are redundant with those in Debug
Doug Simon <doug.simon@oracle.com>
parents:
13551
diff
changeset
|
38 * Debug.log("inner message"); |
667710021ea1
removed methods in Indent that are redundant with those in Debug
Doug Simon <doug.simon@oracle.com>
parents:
13551
diff
changeset
|
39 * ... |
667710021ea1
removed methods in Indent that are redundant with those in Debug
Doug Simon <doug.simon@oracle.com>
parents:
13551
diff
changeset
|
40 * } |
11382
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
41 * } |
14871
667710021ea1
removed methods in Indent that are redundant with those in Debug
Doug Simon <doug.simon@oracle.com>
parents:
13551
diff
changeset
|
42 * |
13142
401830ff96f4
some improvements in Debug logging
Erik Eckstein <erik.eckstein@oracle.com>
parents:
11382
diff
changeset
|
43 * </pre> |
11382
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
44 */ |
13142
401830ff96f4
some improvements in Debug logging
Erik Eckstein <erik.eckstein@oracle.com>
parents:
11382
diff
changeset
|
45 public interface Indent extends AutoCloseable { |
11382
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
46 |
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
47 /** |
14871
667710021ea1
removed methods in Indent that are redundant with those in Debug
Doug Simon <doug.simon@oracle.com>
parents:
13551
diff
changeset
|
48 * Closes the current indentation scope. |
11382
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
49 */ |
13142
401830ff96f4
some improvements in Debug logging
Erik Eckstein <erik.eckstein@oracle.com>
parents:
11382
diff
changeset
|
50 void close(); |
11382
d7d12ef788ba
add logging with indentation in graal.Debug
Erik Eckstein <erik.eckstein@oracle.com>
parents:
diff
changeset
|
51 } |