Skip to content

Commit

Permalink
fixed #18
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo4405 committed Apr 1, 2023
1 parent 9a74828 commit a7bfb0b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
Binary file modified .DS_Store
Binary file not shown.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![GitHub license](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://github.com/shogo4405/Logboard/blob/master/LICENSE.md)

* Simple logging framework for your framework project.
* [API Documentation](https://shogo4405.github.io/Logboard/)
* [API Documentation](https://shogo4405.github.io/Logboard/documentation/logboard/)

## Usage
```swift
Expand All @@ -32,7 +32,7 @@ source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

def import_pods
pod 'Logboard', '~> 2.3.0'
pod 'Logboard', '~> 2.3.1'
end

target 'Your Target' do
Expand All @@ -42,7 +42,7 @@ end
```
### Carthage
```
github "shogo4405/Logboard" ~> 2.3.0
github "shogo4405/Logboard" ~> 2.3.1
```

## Appenders
Expand Down
4 changes: 4 additions & 0 deletions Sources/Logboard/ConsoleAppender.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import Foundation

/// The ConsoleAppender class can output your xcode console with print function.
public class ConsoleAppender: LBLoggerAppender {
/// Creates a ConsoleAppender instance.
public init() {
}

public func append(_ logboard: LBLogger, level: LBLogger.Level, message: [Any], file: StaticString, function: StaticString, line: Int) {
print(LBLogger.dateFormatter.string(from: Date()), "[\(level)]", "[\(logboard.identifier)]", "[\(filename(file.description)):\(line)]", function, ">", message.map({ String(describing: $0) }).joined(separator: ""))
}
Expand Down
4 changes: 4 additions & 0 deletions Sources/Logboard/MultiAppender.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ public class MultiAppender: LBLoggerAppender {
/// The appenders.
public var appenders: [LBLoggerAppender] = []

/// Creates a MultIAppender instance.
public init() {
}

public func append(_ logboard: LBLogger, level: LBLogger.Level, message: [Any], file: StaticString, function: StaticString, line: Int) {
for appender in appenders {
appender.append(logboard, level: level, message: message, file: file, function: function, line: line)
Expand Down
2 changes: 2 additions & 0 deletions Sources/Logboard/NullAppender.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Foundation

/// The NullAppender class does output no message.
public class NullAppender: LBLoggerAppender {
public static let shared = NullAppender()

public func append(_ logboard: LBLogger, level: LBLogger.Level, message: [Any], file: StaticString, function: StaticString, line: Int) {
}

Expand Down
4 changes: 4 additions & 0 deletions Sources/Logboard/SocketAppender.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import Foundation
public class SocketAppender: LBLoggerAppender {
private var socket: NetSocket = NetSocket()

/// Creates a SocketAppende instance.
public init() {
}

/// Connects the Logboard Console service.
public func connect(_ name: String, port: Int) {
socket.connect(withName: name, port: port)
Expand Down

0 comments on commit a7bfb0b

Please sign in to comment.