如何在日志文件中显示参数值而不是问号

时间:2015-12-03 15:39:13

标签: file logging display

如何在日志文件中显示参数值而不是问号,如下所示。

@IBOutlet weak var collectionView: UICollectionView!

// MARK: -View Lifecycle
override func viewDidLoad() {
    super.viewDidLoad()

    collectionView.delegate = self
    collectionView.dataSource = self

    let background = UIView(frame: collectionView.bounds)
    background.backgroundColor = UIColor(red: 26/255.0, green: 26/255.0, blue: 26/255.0, alpha: 0.97)
    collectionView.backgroundView = background

    collectionView.registerNib(UINib(nibName: "Cell", bundle: nil), forCellWithReuseIdentifier: "Cell")

}

我的期望是:

SELECT 
  CASE 
   WHEN (a.CNT = 0 AND b.cnt = 0) THEN 'N'
   ELSE  CASE  WHEN a.CNT = b.CNT THEN 'Y'
         ELSE 'N' END 
   END      AS Final_Status
FROM
  (SELECT NVL(COUNT(*),1) CNT
  FROM FPC_INFO
  WHERE BILL_MONTH_DT = ?
  AND CUST_TYPE_NM    = UPPER(?)
  AND FINALIZED_USER IS NOT NULL
  ) a,
  (SELECT COUNT(*) CNT
  FROM FPC_INFO
  WHERE BILL_MONTH_DT = ?
  AND CUST_TYPE_NM    = UPPER(?)
  ) b

1 个答案:

答案 0 :(得分:0)

对于未格式化的代码感到抱歉。

我在日志文件中记录了如下所示的问号..

  

SELECT CASE WHEN (a.CNT = 0 AND b.cnt = 0) THEN 'N' ELSE CASE WHEN a.CNT = b.CNT THEN 'Y' ELSE 'N' END END AS Final_Status FROM (SELECT NVL(COUNT(),1) CNT FROM FPC_INFO WHERE BILL_MONTH_DT = ? AND CUST_TYPE_NM = UPPER(?) AND FINALIZED_USER IS NOT NULL) a, (SELECT COUNT() CNT FROM FPC_INFO WHERE BILL_MONTH_DT = ? AND CUST_TYPE_NM = UPPER(?)) b

但是我希望它能像下面一样打印,并在日志文件中附加值:

  

SELECT CASE WHEN (a.CNT = 0 AND b.cnt = 0) THEN 'N' ELSE CASE WHEN a.CNT = b.CNT THEN 'Y' ELSE 'N' END END AS Final_Status FROM (SELECT NVL(COUNT(),1) CNT FROM FPC_INFO WHERE BILL_MONTH_DT = '01-SEP-2015' AND CUST_TYPE_NM = UPPER('UVERSE') AND FINALIZED_USER IS NOT NULL) a, (SELECT COUNT() CNT FROM FPC_INFO WHERE BILL_MONTH_DT = '01-SEP-2015' AND CUST_TYPE_NM = UPPER('UVERSE')) b