Swiftpack.co - Package - L1MeN9Yu/Senna

Senna

a log engine based on spdlog

Platforms

  • iOS : 10.0+
  • macOS : 10.14+

Install

specify it in your Cartfile:

github "L1MeN9Yu/Senna"

Usage

See Demo

OSLog in Console.app

As a dynamic library dependency,add 'Senna' as the library name in the filter.

Log Format

Backend format

See spdlog wiki : Custom formatting

The default pattern is : [%D %T] [%=10n] %^[pid : %P] [tid : %t] [%L] %v%$

Frontend format

All the frontend message will be the %v value to backend.

The default MessageConvert is below:

public typealias MessageConvert = (_ message: CustomStringConvertible?, _ filename: String, _ function: String, _ line: Int) -> String

public func register(messageConvert: @escaping MessageConvert) {
    __messageConvert = messageConvert
}

var __messageConvert: MessageConvert = { message, filename, function, line in
    let fileName = filename.components(separatedBy: "/").last ?? ""
    let allMessage = "[\(fileName):\(line)] \(function) - \(message?.description ?? "")"
    return allMessage
}

You can call

Senna.register(messageConvert: your_custom_message_convert)

to disable filename,function,line or whatever you want.

Github

link
Stars: 0

Dependencies

Used By

Total: 0

Releases

1.2.25 - 2020-05-27 03:31:14

Feature

  1. spdlog version 1.6.1

1.2.24 - 2020-05-18 04:09:30

Feature

  1. update spdlog to 1.6.0
  2. use submodule spdlog

1.2.23 - 2020-05-07 06:59:26

Feature

  1. Add Swift Package Support

1.2.22 - 2020-04-22 04:31:51

Feature

  1. OSLog has DefaultOSLogPattern

1.2.11 - 2020-04-17 10:13:07

Fix

  1. Fix OSLog nullptr parameter

1.2.10 - 2020-03-27 08:51:25

Feature

  1. add macos to xcframework

1.2.9 - 2019-12-16 03:54:32

  1. Remove Foundation.URL Dependency
  2. update spdlog/fmt version
  3. update default pattern

1.2.8 - 2019-12-06 06:25:48

1.2.7 - 2019-12-06 05:56:40

1.2.6 - 2019-12-05 02:00:07

Feature

  1. spdlog version 1.5.0

Modify

  1. default pattern : [%D %T] [%=10n] %^[pid : %P] [tid : %t] [%8l] %v%$

1.2.5 - 2019-11-07 10:17:11

Changes

  1. Remove OC Header

Feature

  1. update spdlog

1.2.4 - 2019-11-06 07:09:45

Feature

  1. LogFlag add an initializer

1.2.3 - 2019-11-06 03:54:41

Change

  1. LogFlag change to swift style

1.2.2 - 2019-11-05 08:22:17

Feature

  1. BUILD_LIBRARY_FOR_DISTRIBUTION = YES

1.2.1 - 2019-10-22 06:11:54

Feature

  1. Add macOS Framework

FIx

  1. some warning

1.2.0 - 2019-10-17 10:03:33

Feature

  1. add os log

FIx

  1. set flush on warning

1.1.1 - 2019-10-17 03:17:31

Feature

  1. Add shutDown Function

1.1.0 - 2019-10-16 03:40:40

Feature

  1. File Log
  2. Loger Flush

1.0.1 - 2019-10-12 01:45:12

Feature

  1. spdlog version 1.4.3
  2. Senna start log changed

1.0.0 - 2019-09-30 03:23:43

First Release