Java获取文件名/类名/函数名/行号的方法
来源:互联网 发布:3d打印路径规划算法 编辑:程序博客网 时间:2024/04/27 09:29
public class Debuger {
public static int getLineNumber()
{
return Thread.currentThread().getStackTrace()[2].getLineNumber();
}
public static String getFileName()
{
return Thread.currentThread().getStackTrace()[2].getFileName();
}
public static String getMethodName()
{
return Thread.currentThread().getStackTrace()[2].getMethodName() + "()";
}
public static String getClassName()
{
return Thread.currentThread().getStackTrace()[2].getClassName();
}
public static void print(String text)
{
System.out.println(text);
}
}
public static int getLineNumber()
{
return Thread.currentThread().getStackTrace()[2].getLineNumber();
}
public static String getFileName()
{
return Thread.currentThread().getStackTrace()[2].getFileName();
}
public static String getMethodName()
{
return Thread.currentThread().getStackTrace()[2].getMethodName() + "()";
}
public static String getClassName()
{
return Thread.currentThread().getStackTrace()[2].getClassName();
}
public static void print(String text)
{
System.out.println(text);
}
}
- Java获取文件名/类名/函数名/行号的方法
- Java中获取文件名、类名、方法名、行号的方法
- Java中获取文件名、类名、方法名、行号的方法
- JAVA中如何动态获取得当前的文件名/类名/方法名/行号
- python 获取当前行号 函数名 文件名
- C/C++ 打印文件名、行号、函数名的方法
- C/C++ 打印文件名、行号、函数名的方法 .
- C/C++ 打印文件名、行号、函数名的方法
- Java打印文件名、函数名、行号
- Java打印文件名、函数名、行号
- Android/Java获取当前代码执行时所在的文件名/方法名/行号
- 获取当前运行代码的类名,方法名,行号
- 获取当前运行代码的类名,方法名,行号
- 获取当前运行代码的类名,方法名,行号
- Java中获取当前运行代码的类名、方法名、行号
- Java中获取当前运行代码的类名、方法名、行号
- Java中获取当前运行代码的类名、方法名、行号
- Java中获取当前运行代码的类名、方法名、行号
- fusioncharts生成图表flash遮挡页面中元素的情况
- 拼音字母
- java常用组件GUI设计
- 杂七杂八---常用命令2
- python获取shell命令返回值;python获取进程ID,杀进程
- Java获取文件名/类名/函数名/行号的方法
- 巧遇电话毒品骗局,反思网络环境安全
- Python 正则式学习笔记
- ASP.NET中GridView中嵌套GridView
- 这些道理应该明白
- mysql 四种日志文件
- Zend Framework配置
- 正则表达式30分钟入门教程
- Java 常用类—枚举