You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,7 +132,8 @@ After installing Nebula Logger in your org, there are a few additional configura
132
132
133
133
For Apex developers, the `Logger` class has several methods that can be used to add entries with different logging levels. Each logging level's method has several overloads to support multiple parameters.
134
134
135
-
```apex// This will generate a debug statement within developer console
135
+
```apex
136
+
// This will generate a debug statement within developer console
136
137
System.debug('Debug statement using native Apex');
137
138
138
139
// This will create a new `Log__c` record with multiple related `LogEntry__c` records
@@ -235,7 +236,8 @@ This example batchable class shows how you can leverage this feature to relate a
235
236
236
237
> :information_source: If you deploy this example class to your org,you can run it using `Database.executeBatch(new BatchableLoggerExample());`
237
238
238
-
```apexpublic with sharing class BatchableLoggerExample implements Database.Batchable<SObject>, Database.Stateful {
239
+
```apex
240
+
public with sharing class BatchableLoggerExample implements Database.Batchable<SObject>, Database.Stateful {
239
241
private String originalTransactionId;
240
242
241
243
public Database.QueryLocator start(Database.BatchableContext batchableContext) {
@@ -278,7 +280,8 @@ Queueable jobs can also leverage the parent transaction ID to relate logs togeth
278
280
279
281
> :information_source: If you deploy this example class to your org,you can run it using `System.enqueueJob(new QueueableLoggerExample(3));`
280
282
281
-
```apexpublic with sharing class QueueableLoggerExample implements Queueable {
283
+
```apex
284
+
public with sharing class QueueableLoggerExample implements Queueable {
282
285
private Integer numberOfJobsToChain;
283
286
private String parentLogTransactionId;
284
287
@@ -333,7 +336,8 @@ To see the full list of overloads, check out the `Logger` class [documentation](
333
336
334
337
Each of the logging methods in `Logger` returns an instance of the class `LogEntryEventBuilder`. This class provides several additional methods together to further customize each log entry - each of the builder methods can be chained together. In this example Apex, 3 log entries are created using different approaches for calling `Logger` - all 3 approaches result in identical log entries.
335
338
336
-
```apex// Get the current user so we can log it (just as an example of logging an SObject)
339
+
```apex
340
+
// Get the current user so we can log it (just as an example of logging an SObject)
337
341
User currentUser = [SELECT Id, Name, Username, Email FROM User WHERE Id = :UserInfo.getUserId()];
338
342
339
343
// Using static Logger method overloads
@@ -542,7 +546,8 @@ Nebula Logger supports dynamically tagging/labeling your `LogEntry__c` records v
542
546
543
547
Apex developers can use 2 new methods in `LogEntryBuilder` to add tags - `LogEntryEventBuilder.addTag(String)` and `LogEntryEventBuilder.addTags(List<String>)`.
544
548
545
-
```apex// Use addTag(String tagName) for adding 1 tag at a time
549
+
```apex
550
+
// Use addTag(String tagName) for adding 1 tag at a time
0 commit comments