Skip to content

Commit cf04d95

Browse files
authored
Update README.md (#786)
Fixes Apex code snippets so that syntax highlighting is shown correctly
1 parent 68c4187 commit cf04d95

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ After installing Nebula Logger in your org, there are a few additional configura
132132

133133
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.
134134

135-
```apex// This will generate a debug statement within developer console
135+
```apex
136+
// This will generate a debug statement within developer console
136137
System.debug('Debug statement using native Apex');
137138
138139
// 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
235236

236237
> :information_source: If you deploy this example class to your org,you can run it using `Database.executeBatch(new BatchableLoggerExample());`
237238
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 {
239241
private String originalTransactionId;
240242
241243
public Database.QueryLocator start(Database.BatchableContext batchableContext) {
@@ -278,7 +280,8 @@ Queueable jobs can also leverage the parent transaction ID to relate logs togeth
278280

279281
> :information_source: If you deploy this example class to your org,you can run it using `System.enqueueJob(new QueueableLoggerExample(3));`
280282
281-
```apexpublic with sharing class QueueableLoggerExample implements Queueable {
283+
```apex
284+
public with sharing class QueueableLoggerExample implements Queueable {
282285
private Integer numberOfJobsToChain;
283286
private String parentLogTransactionId;
284287
@@ -333,7 +336,8 @@ To see the full list of overloads, check out the `Logger` class [documentation](
333336

334337
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.
335338

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)
337341
User currentUser = [SELECT Id, Name, Username, Email FROM User WHERE Id = :UserInfo.getUserId()];
338342
339343
// Using static Logger method overloads
@@ -542,7 +546,8 @@ Nebula Logger supports dynamically tagging/labeling your `LogEntry__c` records v
542546

543547
Apex developers can use 2 new methods in `LogEntryBuilder` to add tags - `LogEntryEventBuilder.addTag(String)` and `LogEntryEventBuilder.addTags(List<String>)`.
544548

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
546551
Logger.debug('my log message').addTag('some tag').addTag('another tag');
547552
548553
// Use addTags(List<String> tagNames) for adding a list of tags in 1 method call

0 commit comments

Comments
 (0)