๐Ÿ‘”log()

๐Ÿ’พ ็จ‹ๅผ๏ผš replit โฌ†๏ธ ้œ€่ฆ๏ผš HasMirrors

// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
// 2022.01.27 * (v.1)        + log()
// 2022.01.28 / log()        use Logger instead
// 2022.01.30 + log()        + param `items: [HasMirrors]`
//            / log(_ item:) delegate to `HasMirrors` method
// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

// โญ require `HasMirrors`

/// `log(msg)`
public func log(_ item: HasMirrors) {
    _ = item.log()
}

/// `log(items)`
/// โญ benefit: 
/// - needn't declare `items` as `HasMirrors`,
///   compiler will infer it.
public func log(_ items: [HasMirrors]) {
    items.log()
}

History

  1. (2022.01.27) - first version

  2. (2022.01.28) - use Logger.

Last updated