Caps-Server/Sources/App/Log.swift
christophhagen 4469985959 First try
2020-05-19 15:19:19 +02:00

21 lines
428 B
Swift

//
// Log.swift
// App
//
// Created by Christoph on 05.05.20.
//
import Foundation
private let df: DateFormatter = {
let df = DateFormatter()
df.dateStyle = .short
df.timeStyle = .short
return df
}()
func log(_ message: String, file: String = #file, line: Int = #line) {
let date = df.string(from: Date())
print("[\(date)][\(file.components(separatedBy: "/").last ?? file):\(line)] \(message)")
}