Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
Update ReadMe
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc committed Jul 27, 2014
1 parent a079daa commit 1594c36
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Assets/UniRx/Examples/Sample11_Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace UniRx.Examples
public class Sample11_Logger
{
// UniRx.Diagnostics.Logger
// logger is threadsafe,
// logger is threadsafe, define per class with name.
static readonly Logger logger = new Logger("Sample11");

// call once at applicationinit
Expand All @@ -19,6 +19,7 @@ public void ApplicationInitialize()
ObservableLogger.Listener.LogToUnityDebug();

// for example, filter only Exception and upload to web.
// (make custom sink(IObserver<EventEntry>) is better to use)
ObservableLogger.Listener
.Where(x => x.LogType == LogType.Exception)
.Subscribe(x =>
Expand All @@ -32,6 +33,7 @@ public void Run()
// Debug is write only DebugBuild.
logger.Debug("Debug Message");

// or other logging methods
logger.Log("Message");
logger.Exception(new Exception("test exception"));
}
Expand Down
42 changes: 41 additions & 1 deletion Assets/UniRx/ReadMe.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
UniRx - Reactive Extensions for Unity
UniRx - Reactive Extensions for Unity / ver.4.4
===
Created by Yoshifumi Kawai(neuecc)

Expand All @@ -16,6 +16,8 @@ https://github.com/neuecc/UniRx/issues

Last, send me an email at: [email protected]

Release Notes, see [UniRx/releases](https://github.com/neuecc/UniRx/releases)

Why Rx?
---
Ordinary, Unity Network operation use `WWW` and `Coroutine` but `Coroutine` is not good practice for asynchronous operation.
Expand Down Expand Up @@ -323,6 +325,39 @@ LogHelper.LogCallbackAsObservable()
.Subscribe();
```

Stream Logger
---
```csharp
// using UniRx.Diagnostics;

// logger is threadsafe, define per class with name.
static readonly Logger logger = new Logger("Sample11");

// call once at applicationinit
public static void ApplicationInitialize()
{
// Log as Stream, UniRx.Diagnostics.ObservableLogger.Listener is IObservable<LogEntry>
// You can subscribe and output to any place.
ObservableLogger.Listener.LogToUnityDebug();

// for example, filter only Exception and upload to web.
// (make custom sink(IObserver<EventEntry>) is better to use)
ObservableLogger.Listener
.Where(x => x.LogType == LogType.Exception)
.Subscribe(x =>
{
// ObservableWWW.Post("", null).Subscribe();
});
}

// Debug is write only DebugBuild.
logger.Debug("Debug Message");

// or other logging methods
logger.Log("Message");
logger.Exception(new Exception("test exception"));
```

Unity specified extra gems
---
```csharp
Expand All @@ -349,6 +384,11 @@ Observable.FromCoroutine((observer, token) => enumerator(observer, token));
yield return Observable.Range(1, 10).StartAsCoroutine();
```

Samples
---
see [UniRx/Examples](https://github.com/neuecc/UniRx/tree/master/Assets/UniRx/Examples)
How to ResourceManagement(Sample09_EventHandling), What is MainThreadDispatcher? and other notes.

vs iOS AOT
---
UniRx has AotSafe Utilities.
Expand Down
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Presentation - http://www.slideshare.net/neuecc/unirx-reactive-extensions-for-un

Unity Forums support thread, ask me any questions - http://forum.unity3d.com/threads/248535-UniRx-Reactive-Extensions-for-Unity

Release Notes, see [UniRx/releases](https://github.com/neuecc/UniRx/releases)

Why Rx?
---
Ordinary, Unity Network operation use `WWW` and `Coroutine` but `Coroutine` is not good practice for asynchronous operation.
Expand Down Expand Up @@ -321,6 +323,39 @@ LogHelper.LogCallbackAsObservable()
.Subscribe();
```

Stream Logger
---
```csharp
// using UniRx.Diagnostics;
// logger is threadsafe, define per class with name.
static readonly Logger logger = new Logger("Sample11");

// call once at applicationinit
public static void ApplicationInitialize()
{
// Log as Stream, UniRx.Diagnostics.ObservableLogger.Listener is IObservable<LogEntry>
// You can subscribe and output to any place.
ObservableLogger.Listener.LogToUnityDebug();

// for example, filter only Exception and upload to web.
// (make custom sink(IObserver<EventEntry>) is better to use)
ObservableLogger.Listener
.Where(x => x.LogType == LogType.Exception)
.Subscribe(x =>
{
// ObservableWWW.Post("", null).Subscribe();
});
}

// Debug is write only DebugBuild.
logger.Debug("Debug Message");

// or other logging methods
logger.Log("Message");
logger.Exception(new Exception("test exception"));
```

Unity specified extra gems
---
```csharp
Expand All @@ -346,6 +381,10 @@ Observable.FromCoroutine((observer, token) => enumerator(observer, token));
// convert IObservable to Coroutine
yield return Observable.Range(1, 10).StartAsCoroutine();
```
Samples
---
see [UniRx/Examples](https://github.com/neuecc/UniRx/tree/master/Assets/UniRx/Examples)
How to ResourceManagement(Sample09_EventHandling), What is MainThreadDispatcher? and other notes.

vs iOS AOT
---
Expand Down

0 comments on commit 1594c36

Please sign in to comment.