杨锴
2025-04-16 09a372bc45fde16fd42257ab6f78b8deeecf720b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
//  LogDetails.swift
//  XCGLogger: https://github.com/DaveWoodCom/XCGLogger
//
//  Created by Dave Wood on 2014-06-06.
//  Copyright © 2014 Dave Wood, Cerebral Gardens.
//  Some rights reserved: https://github.com/DaveWoodCom/XCGLogger/blob/main/LICENSE.txt
//
 
import Foundation
 
// MARK: - LogDetails
/// Data structure to hold all info about a log message, passed to destination classes
public struct LogDetails {
 
    /// Log level required to display this log
    public var level: XCGLogger.Level
 
    /// Date this log was sent
    public var date: Date
 
    /// The log message to display
    public var message: String
 
    /// Name of the function that generated this log
    public var functionName: String
 
    /// Name of the file the function exists in
    public var fileName: String
 
    /// The line number that generated this log
    public var lineNumber: Int
 
    /// Dictionary to store miscellaneous data about the log, can be used by formatters and filters etc. Please prefix any keys to help avoid collissions.
    public var userInfo: [String: Any]
 
    public init(level: XCGLogger.Level, date: Date, message: String, functionName: String, fileName: String, lineNumber: Int, userInfo: [String: Any] = [:]) {
        self.level = level
        self.date = date
        self.message = message
        self.functionName = functionName
        self.fileName = fileName
        self.lineNumber = lineNumber
        self.userInfo = userInfo
    }
}