import { hilog } from '@kit.PerformanceAnalysisKit';
import testNapi from 'libentry.so';
import router from '@ohos.router';

const DOMAIN = 0x0000;

@Entry
@Component
struct Index {
  @State message: string = 'Hello World';

  build() {
    Column() {
      // 标题
      Text('日志测试模块')
        .id('LogTitle')
        .fontSize(24)
        .fontWeight(FontWeight.Bold)
        .margin({ top: 50, bottom: 30 })
      
      // 单次日志测试按钮
      Button('单次日志测试')
        .width('80%')
        .height(50)
        .backgroundColor('#007DFF')
        .margin({ bottom: 20 })
        .onClick(() => {
         testNapi.pirntSingleHiLog();

        })
      
      // 一次打印所有层级日志按钮
      Button('一次打印所有层级日志')
        .width('80%')
        .height(50)
        .backgroundColor('#007DFF')
        .margin({ bottom: 20 })
        .onClick(() => {
          testNapi.pirntAllLevelHiLog();
        })
      
      // 大量持续日志输出按钮
      Button('进入持续日志页面')
        .width('80%')
        .height(50)
        .backgroundColor('#007DFF')
        .margin({ bottom: 20 })
        .onClick(() => {
          router.pushUrl({ url: 'pages/ContinuousLogPage' });
        })
      
      // 越界崩溃测试按钮
      Button('进入越界页面')
        .width('80%')
        .height(50)
        .backgroundColor('#FF4444')
        .onClick(() => {
          router.pushUrl({ url: 'pages/FaultPage' });
        })
    }
    .width('100%')
    .height('100%')
  }
}
