Skip to content

Commit

Permalink
feat: create md's file to first release of the sdk (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomerhy authored May 26, 2024
1 parent 38c0147 commit f73dbce
Show file tree
Hide file tree
Showing 10 changed files with 577 additions and 10 deletions.
63 changes: 63 additions & 0 deletions CoralogixRum/Docs/CoralogixDomain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# CoralogixDomain

The `CoralogixDomain` enum represents various Coralogix account domains, each associated with a specific geographical region. Each case in the enum holds the corresponding URL for the Coralogix ingress point.

## Cases

### EU1
```swift
case EU1 = "https://ingress.eu1.rum-ingress-coralogix.com"
```
Represents the EU1 region (eu-west-1, Ireland).

### EU2
```swift
case EU2 = "https://ingress.eu2.rum-ingress-coralogix.com"
```
Represents the EU2 region (eu-north-1, Stockholm).

### US1
```swift
case US1 = "https://ingress.us1.rum-ingress-coralogix.com"
```
Represents the US1 region (us-east-2, Ohio).

### US2
```swift
case US2 = "https://ingress.us2.rum-ingress-coralogix.com"
```
Represents the US2 region (us-west-2, Oregon).

### AP1
```swift
case AP1 = "https://ingress.ap1.rum-ingress-coralogix.com"
```
Represents the AP1 region (ap-south-1, Mumbai).

### AP2
```swift
case AP2 = "https://ingress.ap2.rum-ingress-coralogix.com"
```
Represents the AP2 region (ap-southeast-1, Singapore).

## Methods
### stringValue
```swift
func stringValue() -> String
```
Returns a string representation of the enum case. The returned string corresponds to the case name.

### Example
Here is an example of how to use the stringValue method:

```swift
let domain = CoralogixDomain.EU1
print(domain.stringValue()) // Output: "EU1"
```
Example
Here is an example of how to create an instance of CoralogixDomain and access its raw value:

```swift
let domain = CoralogixDomain.US1
print(domain.rawValue) // Output: "https://ingress.us1.rum-ingress-coralogix.com"
```
72 changes: 72 additions & 0 deletions CoralogixRum/Docs/CoralogixExporterOptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# CoralogixExporterOptions

The `CoralogixExporterOptions` struct provides configuration options for the Coralogix exporter. Below are the detailed descriptions of its properties.

## Properties

### userContext
```swift
var userContext: UserContext?
Configuration for user context. This is an optional property.
```
### debug
```swift
let debug: Bool
```
Turns on/off internal debug logging. This is a required property.

### ignoreUrls
```swift
let ignoreUrls: [String]?
```
URLs that partially match any regex in ignoreUrls will not be traced. In addition, URLs that are exact matches of strings in ignoreUrls will also not be traced. This is an optional property.

### ignoreErrors
```swift
let ignoreErrors: [String]?
```
A pattern for error messages which should not be sent to Coralogix. By default, all errors will be sent. This is an optional property.

### coralogixDomain
```swift
let coralogixDomain: CoralogixDomain
```
Coralogix account domain. This is a required property.

### publicKey
```swift
var publicKey: String
```
Coralogix token, publicly-visible public_key value. This is a required property.

### environment
```swift
let environment: String
```
Specifies the environment, such as development, staging, or production. This is a required property.

### application
```swift
let application: String
```
Name of the application. This is a required property.

### version
```swift
let version: String
```
Version of the application. This is a required property.

### customDomainUrl
```swift
let customDomainUrl: String?
```
Ignore CoralogixDomain URL and route all data calls to a specific URL. This is an optional property.

### labels
```swift
var labels: [String: Any]?
```
Sets labels that are added to every Span. This is an optional property.


67 changes: 67 additions & 0 deletions CoralogixRum/Docs/CoralogixLogSeverity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# CoralogixLogSeverity

The `CoralogixLogSeverity` enum represents the different severity levels for logs in the Coralogix logging system. Each case has an associated integer value.

## Cases

### debug
```swift
case debug = 1
```
Represents debug-level severity. This is used for detailed troubleshooting information.

### verbose
```swift
case verbose = 2
```
Represents verbose-level severity. This is used for more detailed informational events than the standard info level.

### info
```swift
case info = 3
```
Represents informational severity. This is used for general informational messages.

### warn
```swift
case warn = 4
```
Represents warning-level severity. This is used for potentially harmful situations.

### error
```swift
case error = 5
```
Represents error-level severity. This is used for error events that might still allow the application to continue running.

### critical
```swift
case critical = 6
```
Represents critical-level severity. This is used for severe error events that will presumably lead the application to abort.

### Usage Example
Here is an example of how to use the CoralogixLogSeverity enum:

```swift
func logMessage(severity: CoralogixLogSeverity, message: String) {
switch severity {
case .debug:
print("DEBUG: \(message)")
case .verbose:
print("VERBOSE: \(message)")
case .info:
print("INFO: \(message)")
case .warn:
print("WARN: \(message)")
case .error:
print("ERROR: \(message)")
case .critical:
print("CRITICAL: \(message)")
}
}

logMessage(severity: .error, message: "An error occurred in the application.")
```
This enum provides a straightforward way to classify and handle log messages based on their severity level.

Loading

0 comments on commit f73dbce

Please sign in to comment.