Skip to content

JYPjoy/Log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Log

Swift 5.9 Platform SPM

Introduction

Provides a lightweight logging implementation for Swift!

Usage

[STEP 1] Add dependencies

Add this repository's link to Package Dependencies

https://github.com/JYPjoy/Log

[STEP 2] Import packages

import Log

[STEP 3] Basic Usages

Log.t("This is a Trace message.")
Log.d("This is a Debug message.")
Log.i("This is a Informational message.")
Log.n("This is a Notice message.")
Log.w("This is a Warning.")
Log.e("This is a Error.")
Log.c("This is a Critical error.")

Logging Levels

  • You can specify the level of output on initialization. You will see output of that level, and all levels below that.
    Ordered from Least to most Severe.

The order is:

  1. t(TRACE): Appropriate for messages that contain information normally of use only when tracing the execution of a program.
  2. d(DEBUG): Appropriate for messages that contain information normally of use only when debugging a program.
  3. i(INFO): Appropriate for informational messages.
  4. n(NOTICE): Appropriate for conditions that are not error conditions, but that may require special handling.
  5. w(WARNING): Appropriate for messages that are not error conditions, but more severe than .notice
  6. e(ERROR): Appropriate for error conditions.
  7. c(CRITICAL): Appropriate for critical error conditions that usually require immediate attention.

Reference

Swift Official Log Guidelines


License

This library is licensed under MIT license. Full license text is available in LICENSE.

About

A logging framework for Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages