Latest 1.1.3
Homepage https://github.com/ivlevAstef/SIALogger
License MIT
Platforms ios 5.0, requires ARC
Authors

library for simplify log and assertion

Features

  1. Five log levels:
    • Fatal
    • Error
    • Warning
    • Info
    • Trace
  2. Assertion logs – in debug mode abort program, but in release mode only write message.
  3. Log by condition (LogIf)
  4. Configuration
  5. Extensibility
  6. Self log format (beginning with v1.1.0)
  7. Colorful (beginning with v1.1.0)

Install

Via CocoaPods.

Core

pod 'SIALogger' Objective-C
pod 'SIALoggerSwift' Swift (iOS8+) also need write in your PodFile use_frameworks!

Colorful (beginning with v1.1.0)

pod 'SIALogger/Colorful' Objective-C.
pod 'SIALoggerSwift/Colorful' Swift

Usage

Objective-C

#import <SIALogger/SIALogger.h>

...
... {
 [SIALogConfig setOutputs:@[ [SIALogColoredConsoleOutput new] ]];
 [SIALogConfig setFormatTime: @"HH:mm:ss:SSS"];
 [SIALogConfig setMaxLogLevel: SIALogLevels.Info];

 SIALogTrace(@"message");// no print
 SIALogInfo(@"message");//print
 SIALogWarning(@"message");//print
 SIALogError(@"message");//print

 [SIALogConfig setMaxLogLevel: SIALogLevels.Error];
 SIALogTrace(@"message");// no print
 SIALogWarning(@"message");// no print
 SIALogError(@"message");//print

 [SIALogConfig setMaxLogLevel: SIALogLevels.Trace];
 SIALogTraceIf(true, @"message");//print

  if (SIALogTraceIf(false, @"message")) {//no print
    SIALogInfo(@"message");//no print
  }

  if (SIALogInfoIf(true, @"message")) {//print
    SIALogInfo(@"message");//print
  }

  SIALogAssertMsg(false, @"assert");//print, and abort debug
  SIALogFatal(@"message");//print, and always abort
}

Swift

import SIALogger

...
... {
 SIALogConfig.outputs = [ SIALogColoredConsoleOutput() ]
 SIALogConfig.formatTime = "HH:mm:ss:SSS"
 SIALogConfig.maxLogLevel = SIALogLevel.Info

 SIALog.Trace("message") // no print
 SIALog.Info("message") //print
 SIALog.Warning("message") //print
 SIALog.Error("message") //print

 SIALogConfig.maxLogLevel = SIALogLevel.Error
 SIALog.Trace("message") // no print
 SIALog.Warning("message") // no print
 SIALog.Error("message") //print

 SIALogConfig.maxLogLevel = SIALogLevel.Trace
 SIALog.TraceIf(true, msg: "message") //print

  if SIALogTraceIf(false, msg: "message" {//no print
    SIALogInfo("message")//no print
  }

  if SIALogInfoIf(true, msg: "message") {//print
    SIALogInfo("message") //print
  }

  SIALog.Assert(false, msg: "assert") //print, and abort debug
  SIALog.Fatal("message") //print, and always abort
}

Result

log example

Documentation

v1.1.X

Objective-C documentation can be found at SIALogger Objective-C
Swift documentation can be found at SIALogger Swift

v1.0.0

Objective-C documentation can be found at SIALogger Objective-C
Swift documentation can be found at SIALogger Swift

Requirements

  • Objective-C – iOS 5.0+; ARC; Xcode 5.0
  • Swift – iOS 8.0+; ARC; Xcode 7.0

Third Party Tools That Work With XCGLogger

Changelog

See CHANGELOG.md file.

Latest podspec

{
    "name": "SIALogger",
    "version": "1.1.3",
    "summary": "SIALogger - library for simplify log.",
    "description": "SIALogger - library for simplify log and assertion, for Objective-C (If you want to use SIALogger from Swift, see the u201dSIALoggeru201d pod.)n     Supported five log level: {Fatal, Error, Warning, Info, Trace}n     For more information see: https://github.com/ivlevAstef/SIALogger/wiki/SIALogger-Objective-C_v110",
    "homepage": "https://github.com/ivlevAstef/SIALogger",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "documentation_url": "https://github.com/ivlevAstef/SIALogger/wiki/SIALogger-Objective-C_v110",
    "authors": {
        "Alexander.Ivlev": "ivlev.stef@gmail.com"
    },
    "source": {
        "git": "https://github.com/ivlevAstef/SIALogger.git",
        "tag": "v1.1.3"
    },
    "requires_arc": true,
    "platforms": {
        "ios": "5.0"
    },
    "source_files": "ObjC/SIALogger/SIALogger/SIALogger.h",
    "public_header_files": "ObjC/SIALogger/SIALogger/SIALogger.h",
    "default_subspecs": "Core",
    "subspecs": [
        {
            "name": "Core",
            "source_files": "ObjC/SIALogger/SIALogger/Core/**/*.{h,m}",
            "public_header_files": "ObjC/SIALogger/SIALogger/Core/**/*.h"
        },
        {
            "name": "Colorful",
            "xcconfig": {
                "OTHER_CFLAGS": "$(inherited) -D__SIA_LOG_COLORFUL__"
            },
            "dependencies": {
                "SIALogger/Core": []
            },
            "source_files": "ObjC/SIALogger/SIALogger/Colored/**/*.{h,m}",
            "public_header_files": "ObjC/SIALogger/SIALogger/Colored/**/*.h"
        }
    ]
}

Pin It on Pinterest

Share This