[PR #35] [MERGED] Allow to capture log using closure #99

Closed
opened 2025-12-29 18:29:04 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/UrbanApps/Armchair/pull/35
Author: @phimage
Created: 12/15/2015
Status: Merged
Merged: 12/15/2015
Merged by: @coneybeare

Base: masterHead: feature-capturelog


📝 Commits (2)

  • 7a76f71 Allow to capture log using closure
  • 304380a Add global method to set logger closure

📊 Changes

2 files changed (+24 additions, -3 deletions)

View changed files

📝 README.md (+5 -0)
📝 Source/Armchair.swift (+19 -3)

📄 Description

The main purpose is to allow end user to log using their preferred logger system (CocoaLumberjack, XCGLogger, Loggerithm, ...)
(and in bonus this allow also to change formatting by adding, function, line)

For instance with CocoaLumberjack

Manager.defaultManager.logger = { manager, log, file, function, line in
    DDLogDebug(log, file: file, function : function, line: line)
}

As I make it, this an hidden/advanced feature. I can go further if you want :

  • adding a global function
public func logger(logger: ArmchairLogger) {
    Manager.defaultManager.logger = logger
}
  • add information in README (but english is not mother language)
#  in debug, in closure or in a new section Log?
Armchair allows you to set a closure to capture debug log and to plug in the desired logging framework.

Armchair.logger(logger: ArmchairLogger)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/UrbanApps/Armchair/pull/35 **Author:** [@phimage](https://github.com/phimage) **Created:** 12/15/2015 **Status:** ✅ Merged **Merged:** 12/15/2015 **Merged by:** [@coneybeare](https://github.com/coneybeare) **Base:** `master` ← **Head:** `feature-capturelog` --- ### 📝 Commits (2) - [`7a76f71`](https://github.com/UrbanApps/Armchair/commit/7a76f714c4b96d31eb7b9997ef063e569768601d) Allow to capture log using closure - [`304380a`](https://github.com/UrbanApps/Armchair/commit/304380a9acb16555c03ef1952a24d62c46c50ed9) Add global method to set logger closure ### 📊 Changes **2 files changed** (+24 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+5 -0) 📝 `Source/Armchair.swift` (+19 -3) </details> ### 📄 Description The main purpose is to allow end user to log using their preferred logger system ([CocoaLumberjack](https://github.com/CocoaLumberjack/CocoaLumberjack), [XCGLogger](https://github.com/DaveWoodCom/XCGLogger), [Loggerithm](https://github.com/honghaoz/Loggerithm), ...) _(and in bonus this allow also to change formatting by adding, function, line)_ For instance with CocoaLumberjack ``` swift Manager.defaultManager.logger = { manager, log, file, function, line in DDLogDebug(log, file: file, function : function, line: line) } ``` As I make it, this an hidden/advanced feature. I can go further if you want : - adding a global function ``` swift public func logger(logger: ArmchairLogger) { Manager.defaultManager.logger = logger } ``` - add information in README (but english is not mother language) ``` # in debug, in closure or in a new section Log? Armchair allows you to set a closure to capture debug log and to plug in the desired logging framework. Armchair.logger(logger: ArmchairLogger) ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 18:29:04 +01:00
adam closed this issue 2025-12-29 18:29:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Armchair#99