Skip to content

Commit

Permalink
Minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
krollins-mdb committed Jun 6, 2024
1 parent 701f54d commit 8622eeb
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
The Flutter SDK logger conforms to the `Dart Logger class
<https://pub.dev/documentation/logging/latest/logging/Logger-class.html>`__.

To get started, set a log level:
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
To set a custom logger with the Node.js SDK, call :js-sdk:`setLogger()
<classes/Realm-1.html#setLogger>`. This method recieves ``level`` and
``message`` arguments from the database logger. You can use these arguments to
define your own logging behavior.

This sets the logging behavior for all database logging in your application. If
you do not provide a log level, the default value is "info".
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
To set a custom logger with the Node.js SDK, call :js-sdk:`setLogger()
<classes/Realm-1.html#setLogger>`. This method recieves ``level`` and
``message`` arguments from the database logger. You can use these arguments to
define your own logging behavior.

This sets the logging behavior for all database logging in your application. If
you do not provide a log level, the default value is "info".
To get started, set a log level:
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
To set the level of detail reported by the Node.js SDK pass a valid level to
:js-sdk:`Realm.setLogLevel() <classes/Realm-1.html#setLogLevel>`. Valid values
are:

- "all"
- "trace"
- "debug"
- "detail"
- "info"
- "warn"
- "error"
- "fatal"
- "off"
:js-sdk:`Realm.setLogLevel() <classes/Realm-1.html#setLogLevel>`. Refer to
:js-sdk:`LogLevel <types/Realm.App.Sync.LogLevel.html>` for all valid values.

.. note:: Performance and console.log()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- id: javascript
content: |

.. literalinclude:: /examples/MissingPlaceholders/example.js
.. literalinclude:: /examples/generated/node/v12/logger.test.snippet.set-custom-logger.js
:language: javascript
:copyable: false

Expand All @@ -42,6 +42,6 @@
- id: typescript
content: |

.. literalinclude:: /examples/MissingPlaceholders/example.ts
.. literalinclude:: /examples/generated/node/v12/logger.test.snippet.set-custom-logger.ts
:language: typescript
:copyable: false
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- id: javascript
content: |

.. literalinclude:: /examples/generated/node/v12/logger.test.snippet.set-custom-logger.js
.. literalinclude:: /examples/generated/node/v12/logger.test.snippet.set-log-level.ts
:language: javascript

- id: kotlin
Expand All @@ -40,5 +40,5 @@
- id: typescript
content: |

.. literalinclude:: /examples/generated/node/v12/logger.test.snippet.set-custom-logger.ts
.. literalinclude:: /examples/generated/node/v12/logger.test.snippet.set-log-level.ts
:language: typescript
9 changes: 2 additions & 7 deletions source/sdk/test-and-debug/log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ amounts of data depending on your development needs. You can specify
different log levels or custom loggers.

.. warning:: Java SDK Logging Support

The Java SDK does not support the same logging API as the other SDKs.
Instead, it uses a deprecated sync logger. Refer to the Java SDK: Deprecated
Sync Logger section on this page for more details.
Expand Down Expand Up @@ -143,8 +144,7 @@ debugging.

.. include:: /includes/sdk-examples/logger/logging-set-custom-logger-example.rst

After setting a custom logger, you should also initialize the logger and and set
it as the default logger for your database.
After setting a custom logger, you may need to initialize the logger.

.. tabs-drivers::

Expand Down Expand Up @@ -201,11 +201,6 @@ You can turn off logging by setting the log level:

.. include:: /includes/sdk-examples/logger/logging-turn-off-example.rst

.. note:: Flutter SDK Isolates and Logging Behavior

For the Flutter SDK, if you turn off logging from the first isolate, this
stops the default printing logger.

Java SDK: Deprecated Sync Logger
--------------------------------

Expand Down

0 comments on commit 8622eeb

Please sign in to comment.