XCLog is a Swift extension that helps you print something in console when debugging your projects.

Related tags

Logging XCLog
Overview

XCLog

XCLog is a Swift extension that helps you print something in console when debugging your projects.

Installation

  1. Open Xcode > File > Add Packages....
  2. Add https://github.com/Yang-Xijie/XCLog.

Usage

import Foundation
import XCLog

func greet(_ name: String!) {
    guard let name = name else {
        XCLog(.error, "no name")
        return
    }
    print("Hello, \(name)!")
    XCLog("successfully")
}

greet("Roger")
// Hello, Roger!
// [INFO]    22/01/05 01:36:43    greet(_:)    main.swift(11)
//     successfully
greet(nil)
// [ERROR]   22/01/05 01:37:51    greet(_:)    main.swift(7)
//     no name

If you want to disable XCLog, set XCLog.enable to false somewhere in your codes.

Documentation

XCLog supports DocC. Use Xcode > Product > Build Documentation to check it.

You might also like...
Gedatsu provide readable format about AutoLayout error console log
Gedatsu provide readable format about AutoLayout error console log

Gedatsu Gedatsu provide readable format about AutoLayout error console log Abstract At runtime Gedatsu hooks console log and formats it to human reada

JustLog brings logging on iOS to the next level. It supports console, file and remote Logstash logging via TCP socket with no effort. Support for logz.io available.
JustLog brings logging on iOS to the next level. It supports console, file and remote Logstash logging via TCP socket with no effort. Support for logz.io available.

JustLog JustLog takes logging on iOS to the next level. It supports console, file and remote Logstash logging via TCP socket with no effort. Support f

BadgeLog - A light lib that helps and centralize logs in your application
BadgeLog - A light lib that helps and centralize logs in your application

BadgeLog BadgeLog is an iOS Swift library that helps you manage logs within your

A network logger for iOS and macOS projects.

OkLog for iOS and macOS OkLog-Swift is a network logger written in Swift highly inspired by simonpercic's original OkLog implementation to be used in

Shows your current framerate (fps) in the status bar of your iOS app
Shows your current framerate (fps) in the status bar of your iOS app

WatchdogInspector Shows your current framerate (fps) in the status bar of your iOS app Be a good citizen! Don't block your main thread! WatchdogInspec

LogDog is designed to work out of the box, you can use the pre-configured logger anytime, anywhere
LogDog is designed to work out of the box, you can use the pre-configured logger anytime, anywhere

LogDog user-friendly logging apple/swift-log api compatible Usage LogDog is designed to work out of the box, you can use the pre-configured logger any

This is how you can manage and share logs in iOS application.

Logging in Swift In this example, you can find how to print all the logs effciently in iOS application. Along with, you will find how to share logs fo

A simple logger for your swift applications.

AHQSLogger A simple logging system. Usage import AHQSLogger Use the following methods for loggging. Logging an information / debug You can log a simp

Allow users to easily share Diagnostics with your support team to improve the flow of fixing bugs.
Allow users to easily share Diagnostics with your support team to improve the flow of fixing bugs.

Example mail composer Example Report Diagnostics is a library written in Swift which makes it really easy to share Diagnostics Reports to your support

Comments
  • modification  on enableDict should be prohibited

    modification on enableDict should be prohibited

        public static var enableDict: [XCLogType: Bool] = [
            .trace: true,
            .debug: true,
            .info: true,
            .warn: true,
            .error: true,
            .fatal: true,
        ]
    

    One should not add new (key, value) in enableDict.

    opened by Yang-Xijie 0
Owner
A student in Department of Electronic Engineering, Tsinghua University. A leader in Developing Group of THU iOS Club.
null
A lightweight Swift logger, uses `print` in development and `NSLog` in production. Support colourful and formatted output.

Loggerithm A lightweight Swift logger, uses print in Debug and NSLog in Production with colourful output. Why In Swift, we usually use print to log in

HongHao Zhang 270 Oct 8, 2022
Automate box any value! Print log without any format control symbol! Change debug habit thoroughly!

LxDBAnything Automate box any value! Print log without any format control symbol! Change debug habit thoroughly! Installation You only need drag LxD

DeveloperLx 433 Sep 7, 2022
📱💬🚦 TinyConsole is a micro-console that can help you log and display information inside an iOS application, where having a connection to a development computer is not possible.

TinyConsole TinyConsole is a tiny log console to display information while using your iOS app and written in Swift. Usage Wrap your Main ViewControlle

Devran Cosmo Uenal 2k Jan 3, 2023
Customizable Console UI overlay with debug log on top of your iOS App

AEConsole Customizable Console UI overlay with debug log on top of your iOS App AEConsole is built on top of AELog, so you should probably see that fi

Marko Tadić 142 Dec 21, 2022
Styling and coloring your XCTest logs on Xcode Console

XLTestLog Notes with Xcode 8 and XLTestLog Since Xcode 8 killed XcodeColors, the current way using XCTestLog on Xcode 8 is just plain texts with emoji

Xaree Lee 58 Feb 2, 2022
In-App iOS Debugging Tool With Enhanced Logging, Networking Info, Crash reporting And More.

The debugger tool for iOS developer. Display logs, network request, device informations, crash logs while using the app. Easy accessible with its bubble head button ?? . Easy to integrate in any apps, to handle development or testing apps easier. First version, there is plenty of room for improvement.

Remi ROBERT 1.8k Dec 29, 2022
Delightful console output for Swift developers.

Rainbow adds text color, background color and style for console and command line output in Swift. It is born for cross-platform software logging in te

Wei Wang 1.7k Dec 31, 2022
A Swift-based API for reading from & writing to the Apple System Log (more commonly known somewhat inaccurately as "the console")

CleanroomASL Notice: CleanroomASL is no longer supported The Apple System Log facility has been deprecated by Apple. As a result, we've deprecated Cle

Gilt Tech 62 Jan 29, 2022
Simple Design for Swift bridge with Javascript. Also can get javascript console.log.

SDBridgeOC is here. If your h5 partner confused about how to deal with iOS and Android. This Demo maybe help. YouTube video is here. bilibili Video is

null 20 Dec 28, 2022
Gedatsu provide readable format about AutoLayout error console log

Gedatsu Gedatsu provide readable format about AutoLayout error console log Abstract At runtime Gedatsu hooks console log and formats it to human reada

bannzai 520 Jan 6, 2023