├── .editorconfig ├── .gitattributes ├── .github ├── FUNDING.yml ├── dependabot.yml └── workflows │ ├── dotnet-format-daily.yml │ ├── gh-pages.yml │ ├── label-sponsors.yml │ └── requirements.txt ├── .gitignore ├── .vsconfig ├── Clean-Outputs.ps1 ├── Directory.Build.props ├── Directory.Build.targets ├── LICENSE ├── NuGet.config ├── Prism.Plugin.Logging.sln ├── ReadMe.md ├── azure-pipelines.yml ├── build ├── Process-Release.ps1 ├── Sign-Packages.ps1 └── filelist.txt ├── docs ├── .nojekyll ├── CNAME ├── abstractions.md ├── aggregate-logger.md ├── appcenter │ └── index.md ├── appinsights │ └── index.md ├── assets │ ├── favicon.ico │ └── prism-logo.png ├── graylog │ └── index.md ├── index.md ├── loggly │ └── index.md ├── samples.md ├── socket │ ├── index.md │ └── sample-listener.md └── syslog │ └── index.md ├── global.json ├── mkdocs.yml ├── nuget └── NuGet.config ├── plugin.snk ├── prism-logo.png ├── sample ├── LoggingDemo │ ├── ConsoleLoggingDemo.csproj │ ├── ConsoleUtility.cs │ └── Program.cs └── SampleApp │ ├── SampleApp.Android │ ├── Assets │ │ └── AboutAssets.txt │ ├── MainActivity.cs │ ├── Properties │ │ ├── AndroidManifest.xml │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── AboutResources.txt │ │ ├── layout │ │ │ ├── Tabbar.axml │ │ │ └── Toolbar.axml │ │ ├── mipmap-anydpi-v26 │ │ │ ├── icon.xml │ │ │ └── icon_round.xml │ │ ├── mipmap-hdpi │ │ │ ├── icon.png │ │ │ └── launcher_foreground.png │ │ ├── mipmap-mdpi │ │ │ ├── icon.png │ │ │ └── launcher_foreground.png │ │ ├── mipmap-xhdpi │ │ │ ├── icon.png │ │ │ └── launcher_foreground.png │ │ ├── mipmap-xxhdpi │ │ │ ├── icon.png │ │ │ └── launcher_foreground.png │ │ ├── mipmap-xxxhdpi │ │ │ ├── icon.png │ │ │ └── launcher_foreground.png │ │ └── values │ │ │ ├── colors.xml │ │ │ └── styles.xml │ └── SampleApp.Android.csproj │ ├── SampleApp.UWP │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── LargeTile.scale-100.png │ │ ├── LargeTile.scale-200.png │ │ ├── LargeTile.scale-400.png │ │ ├── SmallTile.scale-100.png │ │ ├── SmallTile.scale-200.png │ │ ├── SmallTile.scale-400.png │ │ ├── SplashScreen.scale-100.png │ │ ├── SplashScreen.scale-200.png │ │ ├── SplashScreen.scale-400.png │ │ ├── Square150x150Logo.scale-100.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square150x150Logo.scale-400.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ │ ├── Square44x44Logo.scale-100.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.scale-400.png │ │ ├── Square44x44Logo.targetsize-16.png │ │ ├── Square44x44Logo.targetsize-256.png │ │ ├── Square44x44Logo.targetsize-48.png │ │ ├── StoreLogo.backup.png │ │ ├── StoreLogo.scale-100.png │ │ ├── StoreLogo.scale-200.png │ │ ├── StoreLogo.scale-400.png │ │ ├── Wide310x150Logo.scale-100.png │ │ ├── Wide310x150Logo.scale-200.png │ │ └── Wide310x150Logo.scale-400.png │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── Default.rd.xml │ └── SampleApp.UWP.csproj │ ├── SampleApp.iOS │ ├── AppDelegate.cs │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon1024.png │ │ │ ├── Icon120.png │ │ │ ├── Icon152.png │ │ │ ├── Icon167.png │ │ │ ├── Icon180.png │ │ │ ├── Icon20.png │ │ │ ├── Icon29.png │ │ │ ├── Icon40.png │ │ │ ├── Icon58.png │ │ │ ├── Icon60.png │ │ │ ├── Icon76.png │ │ │ ├── Icon80.png │ │ │ └── Icon87.png │ ├── Entitlements.plist │ ├── Info.plist │ ├── Main.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── Default-568h@2x.png │ │ ├── Default-Portrait.png │ │ ├── Default-Portrait@2x.png │ │ ├── Default.png │ │ ├── Default@2x.png │ │ └── LaunchScreen.storyboard │ └── SampleApp.iOS.csproj │ └── SampleApp │ ├── App.xaml │ ├── App.xaml.cs │ ├── Collections │ └── ObservableDictionary.cs │ ├── Events │ ├── LoggerType.cs │ ├── LoggerUpdatedEvent.cs │ └── UpdateLoggerEvent.cs │ ├── Images │ └── PrismLogo.png │ ├── SampleApp.csproj │ ├── Services │ ├── AppCenterConfig.cs │ ├── AppInsightsConfig.cs │ ├── GelfConfig.cs │ ├── IAppCenterConfig.cs │ ├── IAppInsightsConfig.cs │ ├── IGelfConfig.cs │ ├── ILogglyConfig.cs │ ├── ISyslogConfig.cs │ ├── LogglyConfig.cs │ └── SyslogConfig.cs │ ├── ViewModels │ ├── AppCenterConfigPageViewModel.cs │ ├── AppInsightsConfigPageViewModel.cs │ ├── ConfigViewModelBase.cs │ ├── GelfConfigPageViewModel.cs │ ├── LogGeneratorPageViewModel.cs │ ├── LogglyConfigPageViewModel.cs │ └── SyslogConfigPageViewModel.cs │ ├── Views │ ├── AppCenterConfigPage.xaml │ ├── AppCenterConfigPage.xaml.cs │ ├── AppInsightsConfigPage.xaml │ ├── AppInsightsConfigPage.xaml.cs │ ├── GelfConfigPage.xaml │ ├── GelfConfigPage.xaml.cs │ ├── LogGeneratorPage.xaml │ ├── LogGeneratorPage.xaml.cs │ ├── LogglyConfigPage.xaml │ ├── LogglyConfigPage.xaml.cs │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── SyslogConfigPage.xaml │ └── SyslogConfigPage.xaml.cs │ └── Xaml │ └── EmbeddedImageExtension.cs ├── src ├── Directory.Build.props ├── InternalsVisibleTo.cs ├── Prism.Plugin.Logging.Abstractions │ ├── AggregateLogger.cs │ ├── ConsoleLoggingService.cs │ ├── DefaultLoggingRegistrationExtensions.cs │ ├── DefaultMicrosoftRegistrationExtensions.cs │ ├── IAggregableLogger.cs │ ├── IAggregateLogger.cs │ ├── IAnalyticsService.cs │ ├── ICrashesService.cs │ ├── ILogger.cs │ ├── ILoggerExtensions.cs │ ├── Internals │ │ └── PrismCompatExtensions.cs │ ├── NullLoggingService.cs │ └── Prism.Plugin.Logging.Abstractions.csproj ├── Prism.Plugin.Logging.AppCenter │ ├── AppCenterLogger.cs │ ├── AppCenterLoggerExtensions.cs │ ├── AppCenterMicrosoftDependencyInjectionExtensions.cs │ └── Prism.Plugin.Logging.AppCenter.csproj ├── Prism.Plugin.Logging.AppInsights │ ├── AppInsightsLogger.cs │ ├── AppInsightsMicrosoftDependencyInjectionExtensions.cs │ ├── ApplicationInsightsOptions.cs │ ├── ApplicationInsightsRegistrationExtensions.cs │ ├── IApplicationInsightsOptions.cs │ └── Prism.Plugin.Logging.AppInsights.csproj ├── Prism.Plugin.Logging.Common │ ├── Extensions │ │ ├── ArrayExtensions.cs │ │ ├── DateTimeExtensions.cs │ │ └── StringExtensions.cs │ ├── Http │ │ ├── HttpLogger.cs │ │ └── JsonContent.cs │ ├── Prism.Plugin.Logging.Common.csproj │ └── Sockets │ │ ├── ILogMessage.cs │ │ ├── ISocketLoggerOptions.cs │ │ ├── ISocketMessenger.cs │ │ ├── LogMessage.cs │ │ ├── SocketLogger.cs │ │ ├── SocketLoggerMicrosoftDependencyInjectionExtensions.cs │ │ ├── SocketLoggerOptions.cs │ │ ├── SocketLoggerRegistrationExtensions.cs │ │ └── SocketMessenger.cs ├── Prism.Plugin.Logging.Graylog │ ├── GelfLogger.cs │ ├── GelfMessage.cs │ ├── GelfOptions.cs │ ├── GraylogMicrosoftDependencyInjectionExtensions.cs │ ├── GraylogRegistrationExtensions.cs │ ├── IGelfLogger.cs │ ├── IGelfLoggerExtensions.cs │ ├── IGelfOptions.cs │ ├── Level.cs │ └── Prism.Plugin.Logging.Graylog.csproj ├── Prism.Plugin.Logging.Loggly │ ├── ILogglyOptions.cs │ ├── LogglyHttpLogger.cs │ ├── LogglyMicrosoftDependencyInjectionExtensions.cs │ ├── LogglyOptions.cs │ ├── LogglyRegistrationExtenions.cs │ ├── LogglySyslogLogger.cs │ ├── LogglySyslogMessage.cs │ ├── LogglySyslogOptions.cs │ └── Prism.Plugin.Logging.Loggly.csproj └── Prism.Plugin.Logging.Syslog │ ├── Facility.cs │ ├── ISyslogLogger.cs │ ├── ISyslogLoggerExtensions.cs │ ├── ISyslogOptions.cs │ ├── Level.cs │ ├── Prism.Plugin.Logging.Syslog.csproj │ ├── SyslogLogger.cs │ ├── SyslogLoggerRegistrationExtensions.cs │ ├── SyslogMessage.cs │ ├── SyslogMicrosoftDependencyInjectionExtensions.cs │ └── SyslogOptions.cs ├── tests ├── Directory.Build.props ├── Prism.Plugin.Logging.AppCenter.Tests │ ├── Prism.Plugin.Logging.AppCenter.Tests.csproj │ └── Tests │ │ └── AppCenterRegistrationTests.cs └── Prism.Plugin.Logging.Tests │ ├── Mocks │ ├── LogMessageMock.cs │ ├── LoggerMock.cs │ └── MockLogMessage.cs │ ├── Prism.Plugin.Logging.Tests.csproj │ ├── Tests │ ├── Extensions │ │ ├── ArrayExtensionTests.cs │ │ ├── DateTimeExtensionTests.cs │ │ ├── ILoggerExtensionTests.cs │ │ └── StringExtensionTests.cs │ ├── FileSystem.cs │ ├── FileSystemTestCollection.cs │ ├── Loggers │ │ ├── LogListener.cs │ │ ├── LogListenerTestCollection.cs │ │ ├── SocketMessengerCacheTests.cs │ │ └── SyslogLoggerTests.cs │ └── Registration │ │ ├── ConsoleLoggerTests.cs │ │ ├── GraylogRegistrationTests.cs │ │ ├── LogglyHttpRegistrationTests.cs │ │ ├── LogglySyslogRegistrationTests.cs │ │ ├── SocketLoggerRegistrationTests.cs │ │ └── SyslogRegistrationTests.cs │ └── xunit.runner.json ├── theme └── partials │ └── footer.html └── version.json /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | *.cs text eol=lf 5 | *.csproj text eol=lf 6 | *.props text eol=lf 7 | *.targets text eol=lf 8 | *.sln text eol=lf 9 | *.json text eol=lf 10 | *.md text eol=lf 11 | *.yml text eol=lf 12 | 13 | ############################################################################### 14 | # Set default behavior for command prompt diff. 15 | # 16 | # This is need for earlier builds of msysgit that does not have it on by 17 | # default for csharp files. 18 | # Note: This is only used by command line 19 | ############################################################################### 20 | #*.cs diff=csharp 21 | 22 | ############################################################################### 23 | # Set the merge driver for project and solution files 24 | # 25 | # Merging from the command prompt will add diff markers to the files if there 26 | # are conflicts (Merging from VS is not affected by the settings below, in VS 27 | # the diff markers are never inserted). Diff markers may cause the following 28 | # file extensions to fail to load in VS. An alternative would be to treat 29 | # these files as binary and thus will always conflict and require user 30 | # intervention with every merge. To do so, just uncomment the entries below 31 | ############################################################################### 32 | #*.sln merge=binary 33 | #*.csproj merge=binary 34 | #*.vbproj merge=binary 35 | #*.vcxproj merge=binary 36 | #*.vcproj merge=binary 37 | #*.dbproj merge=binary 38 | #*.fsproj merge=binary 39 | #*.lsproj merge=binary 40 | #*.wixproj merge=binary 41 | #*.modelproj merge=binary 42 | #*.sqlproj merge=binary 43 | #*.wwaproj merge=binary 44 | 45 | ############################################################################### 46 | # behavior for image files 47 | # 48 | # image files are treated as binary by default. 49 | ############################################################################### 50 | #*.jpg binary 51 | #*.png binary 52 | #*.gif binary 53 | 54 | ############################################################################### 55 | # diff behavior for common document formats 56 | # 57 | # Convert binary document formats to text before diffing them. This feature 58 | # is only available from the command line. Turn it on by uncommenting the 59 | # entries below. 60 | ############################################################################### 61 | #*.doc diff=astextplain 62 | #*.DOC diff=astextplain 63 | #*.docx diff=astextplain 64 | #*.DOCX diff=astextplain 65 | #*.dot diff=astextplain 66 | #*.DOT diff=astextplain 67 | #*.pdf diff=astextplain 68 | #*.PDF diff=astextplain 69 | #*.rtf diff=astextplain 70 | #*.RTF diff=astextplain 71 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: dansiegel 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: nuget 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | time: "13:00" 8 | open-pull-requests-limit: 3 9 | ignore: 10 | - dependency-name: Microsoft.ApplicationInsights 11 | versions: 12 | - 2.17.0 13 | - dependency-name: Xamarin.Essentials 14 | versions: 15 | - 1.6.1 16 | - dependency-name: Microsoft.AppCenter.Analytics 17 | versions: 18 | - 4.1.0 19 | - dependency-name: Microsoft.NET.Test.Sdk 20 | versions: 21 | - 16.8.3 22 | -------------------------------------------------------------------------------- /.github/workflows/dotnet-format-daily.yml: -------------------------------------------------------------------------------- 1 | name: Daily code format check 2 | on: 3 | schedule: 4 | - cron: 0 0 * * * # Every day at midnight (UTC) 5 | jobs: 6 | dotnet-format: 7 | runs-on: windows-latest 8 | steps: 9 | - name: Install dotnet-format 10 | run: dotnet tool install -g dotnet-format 11 | 12 | - name: Checkout repo 13 | uses: actions/checkout@v2 14 | with: 15 | ref: ${{ github.head_ref }} 16 | 17 | - name: Run dotnet format 18 | id: format 19 | uses: jfversluis/dotnet-format@v1.0.5 20 | with: 21 | repo-token: ${{ secrets.GITHUB_TOKEN }} 22 | action: "fix" 23 | #only-changed-files: true # only works for PRs 24 | workspace: "Prism.Plugin.Logging.sln" 25 | 26 | - name: Commit files 27 | if: steps.format.outputs.has-changes == 'true' 28 | run: | 29 | git config --local user.name "github-actions[bot]" 30 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 31 | git commit -a -m 'Automated dotnet-format update' 32 | 33 | - name: Create Pull Request 34 | uses: peter-evans/create-pull-request@v3 35 | with: 36 | title: '[housekeeping] Automated PR to fix formatting errors' 37 | body: | 38 | Automated PR to fix formatting errors 39 | committer: GitHub 40 | author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> 41 | labels: housekeeping 42 | assignees: dansiegel 43 | reviewers: dansiegel 44 | branch: housekeeping/fix-codeformatting 45 | 46 | # Pushing won't work to forked repos 47 | # - name: Commit files 48 | # if: steps.format.outputs.has-changes == 'true' 49 | # run: | 50 | # git config --local user.name "github-actions[bot]" 51 | # git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 52 | # git commit -a -m 'Automated dotnet-format update 53 | # Co-authored-by: ${{ github.event.pull_request.user.login }} <${{ github.event.pull_request.user.id }}+${{ github.event.pull_request.user.login }}@users.noreply.github.com>' 54 | 55 | # - name: Push changes 56 | # if: steps.format.outputs.has-changes == 'true' 57 | # uses: ad-m/github-push-action@v0.6.0 58 | # with: 59 | # github_token: ${{ secrets.GITHUB_TOKEN }} 60 | # branch: ${{ github.event.pull_request.head.ref }} -------------------------------------------------------------------------------- /.github/workflows/gh-pages.yml: -------------------------------------------------------------------------------- 1 | name: github pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | paths: 8 | - 'docs/**' 9 | - 'theme/**' 10 | - 'mkdocs.yml' 11 | 12 | jobs: 13 | build-deploy: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@master 17 | 18 | - name: Setup Python 19 | uses: actions/setup-python@v1 20 | with: 21 | python-version: '3.6' 22 | architecture: 'x64' 23 | 24 | - name: Cache dependencies 25 | uses: actions/cache@v1 26 | with: 27 | path: ~/.cache/pip 28 | key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} 29 | restore-keys: | 30 | ${{ runner.os }}-pip- 31 | 32 | - name: Install dependencies 33 | run: | 34 | python3 -m pip install --upgrade pip 35 | python3 -m pip install -r ./.github/workflows/requirements.txt 36 | 37 | - run: mkdocs build 38 | 39 | - name: Deploy 40 | uses: peaceiris/actions-gh-pages@v3 41 | with: 42 | deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} 43 | publish_dir: ./site -------------------------------------------------------------------------------- /.github/workflows/label-sponsors.yml: -------------------------------------------------------------------------------- 1 | name: Label sponsors 2 | on: 3 | pull_request: 4 | types: [opened] 5 | issues: 6 | types: [opened] 7 | jobs: 8 | build: 9 | name: Add Sponsor Labels 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Add Sponsor Labels 13 | id: sponsor-labels 14 | uses: brianlagunas/sponsor-action@v1.0 15 | with: 16 | github_token: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/requirements.txt: -------------------------------------------------------------------------------- 1 | mkdocs>=1.0.4 2 | mkdocs-material>=4.5.0 -------------------------------------------------------------------------------- /.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Component.CoreEditor", 5 | "Microsoft.VisualStudio.Workload.CoreEditor", 6 | "Microsoft.NetCore.Component.Runtime.5.0", 7 | "Microsoft.NetCore.Component.Runtime.3.1", 8 | "Microsoft.NetCore.Component.SDK", 9 | "Microsoft.VisualStudio.Component.NuGet", 10 | "Microsoft.Net.Component.4.6.1.TargetingPack", 11 | "Microsoft.VisualStudio.Component.Roslyn.Compiler", 12 | "Microsoft.VisualStudio.Component.Roslyn.LanguageServices", 13 | "Microsoft.VisualStudio.Component.FSharp", 14 | "Microsoft.ComponentGroup.ClickOnce.Publish", 15 | "Microsoft.NetCore.Component.DevelopmentTools", 16 | "Microsoft.Net.Component.4.8.SDK", 17 | "Microsoft.Net.Component.4.7.2.TargetingPack", 18 | "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", 19 | "Microsoft.Component.MSBuild", 20 | "Microsoft.VisualStudio.Component.Debugger.JustInTime", 21 | "Microsoft.VisualStudio.Component.IntelliCode", 22 | "Microsoft.Net.ComponentGroup.4.6.1.DeveloperTools", 23 | "Microsoft.Net.Component.4.8.TargetingPack", 24 | "Microsoft.Net.ComponentGroup.4.8.DeveloperTools", 25 | "Component.OpenJDK", 26 | "Microsoft.VisualStudio.Component.MonoDebugger", 27 | "Microsoft.VisualStudio.Component.Merq", 28 | "Component.Xamarin.RemotedSimulator", 29 | "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine", 30 | "Component.Xamarin", 31 | "Component.Android.SDK30", 32 | "Microsoft.VisualStudio.Workload.NetCrossPlat", 33 | "Component.HAXM.Private", 34 | "Microsoft.VisualStudio.Component.NuGet.BuildTools", 35 | "Microsoft.Component.CodeAnalysis.SDK" 36 | ] 37 | } -------------------------------------------------------------------------------- /Clean-Outputs.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem .\ -Include bin,obj -Recurse | ForEach-Object ($_) { Remove-Item $_.Fullname -Force -Recurse } 2 | Get-ChildItem .\ -Include .mfractor -Attributes Hidden -Recurse | ForEach-Object ($_) { Remove-Item $_.Fullname -Force -Recurse } 3 | Get-ChildItem .\ -Include .vs -Attributes Hidden -Recurse | ForEach-Object ($_) { Remove-Item $_.Fullname -Force -Recurse } 4 | Get-ChildItem .\ -Include *.csproj.user -Recurse | ForEach-Object ($_) { Remove-Item $_.Fullname -Force -Recurse } -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2.12 5 | Dan Siegel 6 | Dan Siegel 7 | © Dan Siegel. All rights reserved. 8 | MIT 9 | https://github.com/dansiegel/Prism.Plugin.Logging 10 | false 11 | git 12 | https://github.com/dansiegel/Prism.Plugin.Logging.git 13 | prism;logging 14 | $(NoWarn);1701;1702;CS1591 15 | en-US 16 | True 17 | True 18 | latest 19 | $(MSBuildThisFileDirectory) 20 | 21 | 22 | 23 | 24 | snupkg 25 | true 26 | true 27 | $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb 28 | 29 | 30 | 31 | 32 | $(MSBuildThisFileDirectory)/Artifacts 33 | $(BUILD_ARTIFACTSTAGINGDIRECTORY) 34 | false 35 | 36 | 37 | 38 | true 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | $(AssemblyName) ($(TargetFramework)) 4 | 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2018 Dan Siegel 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /NuGet.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /build/Process-Release.ps1: -------------------------------------------------------------------------------- 1 | try { 2 | $artifactDirectory = $env:PIPELINE_WORKSPACE 3 | Write-Host "Currect working directory $artifactDirectory" 4 | $nupkg = Get-ChildItem -Path $artifactDirectory -Filter *.nupkg -Recurse | Select-Object -First 1 5 | 6 | if($null -eq $nupkg) { 7 | Throw "No NuGet Package could be found in the current directory" 8 | } 9 | 10 | Write-Host "Package Name $($nupkg.Name)" 11 | $nupkg.Name -match '^(.*?)\.((?:\.?[0-9]+){3,}(?:[-a-z]+)?)\.nupkg$' 12 | 13 | $VersionName = $Matches[2] 14 | $IsPreview = $VersionName -match '-beta$' 15 | $ReleaseDisplayName = $VersionName 16 | 17 | Write-Output ("##vso[task.setvariable variable=IS_PREVIEW;]$IsPreview") 18 | 19 | if($true -eq $IsPreview) { 20 | $ReleaseDisplayName = "$VersionName - Preview" 21 | } 22 | 23 | Write-Host "Version Name" $VersionName 24 | Write-Host "Release Display Name $ReleaseDisplayName" 25 | Write-Output ("##vso[task.setvariable variable=VersionName;]$VersionName") 26 | Write-Output ("##vso[task.setvariable variable=ReleaseDisplayName;]$ReleaseDisplayName") 27 | } 28 | catch { 29 | Write-Error $_ 30 | exit 1 31 | } -------------------------------------------------------------------------------- /build/Sign-Packages.ps1: -------------------------------------------------------------------------------- 1 | $currentDirectory = Split-Path $MyInvocation.MyCommand.Definition 2 | 3 | # See if we have the ClientSecret available 4 | if([string]::IsNullOrEmpty($env:SignClientSecret)){ 5 | Write-Host "Client Secret not found, not signing packages" 6 | return; 7 | } 8 | 9 | dotnet tool install --tool-path . SignClient 10 | 11 | # Setup Variables we need to pass into the sign client tool 12 | 13 | $appSettings = "$currentDirectory\appsettings.json" 14 | $fileList = "$currentDirectory\filelist.txt" 15 | $repoName = $env:BUILD_REPOSITORY_NAME -replace ".*/","" 16 | 17 | $azureAd = @{ 18 | SignClient = @{ 19 | AzureAd = @{ 20 | AADInstance = $env:SignClientAADInstance 21 | ClientId = $env:SignClientClientId 22 | TenantId = $env:SignClientTenantId 23 | } 24 | Service = @{ 25 | Url = $env:SignServiceUrl 26 | ResourceId = $env:SignServiceResourceId 27 | } 28 | } 29 | } 30 | 31 | $azureAd | ConvertTo-Json -Compress | Out-File $appSettings 32 | 33 | $nupkgs = Get-ChildItem $env:BUILD_ARTIFACTSTAGINGDIRECTORY\*.nupkg -recurse | Select-Object -ExpandProperty FullName 34 | 35 | foreach ($nupkg in $nupkgs){ 36 | Write-Host "Submitting $nupkg for signing" 37 | 38 | .\SignClient 'sign' -c $appSettings -i $nupkg -f $fileList -r $env:SignClientUser -s $env:SignClientSecret -n $repoName -d $repoName -u $env:BUILD_REPOSITORY_URI 39 | 40 | Write-Host "Finished signing $nupkg" 41 | } 42 | 43 | Write-Host "Sign-package complete" -------------------------------------------------------------------------------- /build/filelist.txt: -------------------------------------------------------------------------------- 1 | **/Prism.* -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/docs/.nojekyll -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | logging.prismplugins.com -------------------------------------------------------------------------------- /docs/abstractions.md: -------------------------------------------------------------------------------- 1 | There are several interfaces provided by Prism.Plugin.Logging in the Abstractions package. While you can register any of the given services, most applications would simply register an make use of the `ILogger` interface. This gives you the greatest flexibility to determine what type of logging you would like to do. You may notice that these interfaces provide a more modern context and largely match the API's provided by App Center for collecting Analytics and Tracking Errors within your application. 2 | 3 | ```c# 4 | public interface IAnalyticsService 5 | { 6 | void TrackEvent(string name, IDictionary properties); 7 | } 8 | 9 | public interface ICrashesService 10 | { 11 | void Report(Exception ex, IDictionary properties); 12 | } 13 | 14 | public interface ILogger : ILoggerFacade, IAnalyticsService, ICrashesService 15 | { 16 | void Log(string message, IDictionary properties); 17 | } 18 | ``` 19 | 20 | !!! Note "Note" 21 | Base implementations are also provided in the Abstractions package for Null Logging and Console Logging. 22 | -------------------------------------------------------------------------------- /docs/aggregate-logger.md: -------------------------------------------------------------------------------- 1 | # Aggregate Logger 2 | 3 | There may be times in which you want to log to multiple outputs. For this time an AggregateLogger has been provided in the Abstractions package. You can set it up as follows: 4 | 5 | ```c# 6 | private AggregateLogger _logger; 7 | 8 | protected override void OnInitialized() 9 | { 10 | AppCenter.Start("{your application secrets}", typeof(Analytics), typeof(Crashes)); 11 | _logger.AddLoggers( 12 | // NOTE: None of these need to be explicitly registered as you 13 | // are resolving concrete types 14 | Container.Resolve(), 15 | Container.Resolve(), 16 | Container.Resolve() 17 | ); 18 | } 19 | 20 | protected override void RegisterTypes(IContainerRegistry containerRegistry) 21 | { 22 | _logger = new AggregateLogger(); 23 | containerRegistry.RegisterInstance(_logger); 24 | containerRegistry.Register(); 25 | } 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/appcenter/index.md: -------------------------------------------------------------------------------- 1 | # App Center 2 | 3 | App Center is a very popular and FREE platform provided by Microsoft for tracking Analytics about your users and collecting crash analytics. With support for most Xamarin applications this is a very good platform to use when developing Prism.Forms applications. 4 | 5 | For more information see the [App Center](https://appcenter.ms/) website. 6 | 7 | ## Setup 8 | 9 | The App Center Logger requires no explicit setup in terms of registering additional configuration classes. You will however need to be sure to start the App Center Analytics and Crashes using their standard API's. 10 | 11 | ```c# 12 | AppCenter.Start("{your app secret}", typeof(Analytics), typeof(Crashes)); 13 | 14 | // For Xamarin.Forms 15 | AppCenter.Start("ios:{your ios app secret};uwp{your uwp app secret};android:{your android app secret};", typeof(Analytics), typeof(Crashes)); 16 | 17 | ``` 18 | -------------------------------------------------------------------------------- /docs/appinsights/index.md: -------------------------------------------------------------------------------- 1 | # Application Insights 2 | 3 | !!! question "What is Application Insights" 4 | Application Insights, a feature of Azure Monitor, is an extensible Application Performance Management (APM) service for web developers on multiple platforms. Use it to monitor your live web application. It will automatically detect performance anomalies. It includes powerful analytics tools to help you diagnose issues and to understand what users actually do with your app. It's designed to help you continuously improve performance and usability. 5 | 6 | !!! info "Info" 7 | For more information see the [Application Insights](https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview) documentation. 8 | 9 | ## Setup 10 | 11 | In order to get started with Application Insights you will need to be sure to provide an implementation of the IApplicationInsightsOptions to provide the logger with your InstrumentationKey and any UserTraits which you want Application Insights to track. This may include properties such as information on what type of device, OS, etc that your user is using your application on. 12 | 13 | ```c# 14 | public interface IApplicationInsightsOptions 15 | { 16 | string InstrumentationKey { get; } 17 | 18 | IDictionary UserTraits { get; } 19 | } 20 | ``` 21 | -------------------------------------------------------------------------------- /docs/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/docs/assets/favicon.ico -------------------------------------------------------------------------------- /docs/assets/prism-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/docs/assets/prism-logo.png -------------------------------------------------------------------------------- /docs/graylog/index.md: -------------------------------------------------------------------------------- 1 | # Graylog 2 | 3 | Graylog is a leading centralized log management solution built to open standards for capturing, storing, and enabling real-time analysis of terabytes of machine data. This offers a better user experience by making analysis ridiculously fast, efficient, cost-effective, and flexible. Graylog is offered both as an Open Source and Enterprise solution. 4 | 5 | For more information about [Graylog](https://www.graylog.org/) be sure to check out their website and docs. 6 | 7 | !!! Info "Info" 8 | Graylog support is offered using the Graylog Extended Logging Format (GELF) although you may also elect to use the Syslog Logger to log to a Graylog Server 9 | 10 | ## Setup 11 | 12 | The setup for Graylog is very easy as you simply need to provide a Uri for where to send the logs to. 13 | 14 | ```c# 15 | public interface IGelfOptions 16 | { 17 | Uri Host { get; } 18 | } 19 | ``` 20 | 21 | !!! Note "Note" 22 | Logs are sent via a HttpClient asynchronously in the background. The logging plugin currently does not handle scenarios where you may lose connection. Any logs that are sent while offline may be lost. 23 | -------------------------------------------------------------------------------- /docs/loggly/index.md: -------------------------------------------------------------------------------- 1 | # Loggly 2 | 3 | TODO 4 | 5 | ## Loggly Syslog 6 | 7 | ## Loggly Http 8 | -------------------------------------------------------------------------------- /docs/samples.md: -------------------------------------------------------------------------------- 1 | TODO -------------------------------------------------------------------------------- /docs/socket/index.md: -------------------------------------------------------------------------------- 1 | # Socket Logger 2 | 3 | TODO 4 | -------------------------------------------------------------------------------- /docs/socket/sample-listener.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/docs/socket/sample-listener.md -------------------------------------------------------------------------------- /docs/syslog/index.md: -------------------------------------------------------------------------------- 1 | # Syslog 2 | 3 | !!! question "What is Syslog?" 4 | Syslog is a way for network devices to send event messages to a logging server – usually known as a Syslog server. The Syslog protocol is supported by a wide range of devices and can be used to log different types of events. For example, a router might send messages about users logging on to console sessions, while a web-server might log access-denied events. 5 | https://www.networkmanagementsoftware.com/what-is-syslog/ 6 | 7 | The Syslog Logger can be a great development tool, particular for Mobile Developers which may be running test builds on devices while disconnected from Visual Studio and the Debug Console. This can be very easily achieved on Windows by installing any one of a number of Syslog Servers, where this will enabled you as a developer to get a stream of log data directly to your desktop separate from Visual Studio. 8 | 9 | !!! Note "Note" 10 | The Syslog Logger is built on top of the Socket Messenger in the `Prism.Plugin.Logging.Common` NuGet package. All Syslog messages use the Udp Protocol with a max buffer size of 65500. 11 | 12 | ## Setup 13 | 14 | Logging Syslog messages is quite easy and simple but requires a few properties to be set. You must set both the Port and AppNameOrTag properties for the Syslog Logger to know where to send the log message and which tag to use to help you filter logs. 15 | 16 | ```c# 17 | public interface ISyslogOptions 18 | { 19 | string HostNameOrIp { get; } 20 | 21 | int? Port { get; } 22 | 23 | string AppNameOrTag { get; } 24 | } 25 | ``` 26 | 27 | !!! Note "Note" 28 | If no Port is specified the default Syslog port 514 will be used. 29 | 30 | ## See Also 31 | 32 | - [Socket Logger](../socket/index.md) 33 | - [Free Desktop Syslog Servers](https://www.ittsystems.com/best-free-syslog-server-windows/) 34 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "3.1.300", 4 | "rollForward": "latestMinor", 5 | "allowPrerelease": false 6 | }, 7 | "msbuild-sdks": { 8 | "MSBuild.Sdk.Extras": "3.0.23" 9 | } 10 | } -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | # Project Information 2 | site_name: Prism.Plugin.Logging 3 | site_description: Documentation for the Prism Logging Plugin 4 | site_author: Dan Siegel 5 | site_url: http://logging.prismplugins.com 6 | 7 | # Repository 8 | repo_name: dansiegel/Prism.Plugin.Logging 9 | repo_url: https://github.com/dansiegel/Prism.Plugin.Logging 10 | edit_uri: '' 11 | 12 | # Copyright 13 | copyright: 'Copyright © 2016 - 2021 Dan Siegel' 14 | 15 | # Configuration 16 | theme: 17 | name: 'material' 18 | custom_dir: 'theme' 19 | icon: 20 | repo: fontawesome/brands/github 21 | logo: assets/prism-logo.png 22 | favicon: assets/favicon.ico 23 | language: en 24 | features: 25 | - navigation.tabs 26 | - navigation.tabs.sticky 27 | palette: 28 | primary: 'white' 29 | accent: 'cyan' 30 | 31 | # Social 32 | extra: 33 | social: 34 | - icon: fontawesome/brands/html5 35 | link: https://dansiegel.net 36 | - icon: fontawesome/brands/github 37 | link: https://github.com/dansiegel 38 | - icon: fontawesome/brands/twitch 39 | link: https://twitch.tv/dansiegel 40 | - icon: fontawesome/brands/twitter 41 | link: https://twitter.com/DanJSiegel 42 | - icon: fontawesome/brands/linkedin 43 | link: https://linkedin.com/in/DanSiegel 44 | 45 | # Extensions 46 | markdown_extensions: 47 | - admonition: 48 | - codehilite: 49 | linenums: false 50 | - toc: 51 | permalink: true 52 | 53 | nav: 54 | - Prism: 55 | - Prism: http://prismlibrary.github.io/docs 56 | - Logging: 57 | - Getting Started: index.md 58 | - Abstractions: abstractions.md 59 | - Aggregate Logger: aggregate-logger.md 60 | - App Center: appcenter/index.md 61 | - Application Insights: appinsights/index.md 62 | - Graylog: graylog/index.md 63 | - Loggly: loggly/index.md 64 | - Socket Logger: socket/index.md 65 | - Syslog: syslog/index.md 66 | - Samples: samples.md 67 | - Popups: 68 | - Popups: http://popups.prismplugins.com 69 | - Container Extensions: 70 | - Container Extensions: http://prismplugins.com 71 | - Mobile.BuildTools: 72 | - Mobile.BuildTools: http://mobilebuildtools.com 73 | 74 | google_analytics: 75 | - UA-153405647-2 76 | - auto 77 | -------------------------------------------------------------------------------- /nuget/NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /plugin.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/plugin.snk -------------------------------------------------------------------------------- /prism-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/prism-logo.png -------------------------------------------------------------------------------- /sample/LoggingDemo/ConsoleLoggingDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | netcoreapp2.1 6 | False 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sample/LoggingDemo/ConsoleUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using static System.Console; 3 | 4 | namespace LoggingDemo 5 | { 6 | public static class ConsoleUtility 7 | { 8 | public const string UNKNOWN = "unknown"; 9 | 10 | public static string Option(string question, params string[] options) 11 | { 12 | if (options == null || options.Length == 0) return UNKNOWN; 13 | 14 | WriteLine(question); 15 | for (int i = 1; i <= options.Length; i++) 16 | { 17 | WriteLine($"{i}) {options[i - 1]}"); 18 | } 19 | WriteLine(); 20 | WriteLine("Select the number of the option you wish to choose..."); 21 | if (int.TryParse(ReadLine(), out int result) && result <= options.Length) 22 | { 23 | return options[result - 1]; 24 | } 25 | 26 | return UNKNOWN; 27 | } 28 | 29 | public static string Question(string question) 30 | { 31 | WriteLine(question); 32 | return ReadLine(); 33 | } 34 | 35 | public static T Question(string question) 36 | { 37 | return (T)Convert.ChangeType(Question(question), typeof(T)); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sample/LoggingDemo/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Prism.Logging; 4 | using Prism.Logging.Loggly; 5 | using Prism.Logging.Syslog; 6 | 7 | namespace LoggingDemo 8 | { 9 | class Program 10 | { 11 | static bool Continue = true; 12 | const string Generic = "Generic Syslog"; 13 | const string LogglySyslog = "Loggly Syslog"; 14 | const string LogglyHttp = "Loggly Http"; 15 | 16 | static void Main(string[] args) 17 | { 18 | var logger = GetLogger(); 19 | while (Continue) 20 | { 21 | Console.Clear(); 22 | string message = ConsoleUtility.Question("Enter a test message, or type 'quit' to exit:"); 23 | if (message.Equals("quit", StringComparison.OrdinalIgnoreCase)) 24 | { 25 | break; 26 | } 27 | logger.Log(message, new Dictionary { { "Category", "Demo" } }); 28 | } 29 | 30 | Console.WriteLine("Thanks for logging"); 31 | } 32 | 33 | private static ILogger GetLogger() 34 | { 35 | switch (ConsoleUtility.Option("Which Logger would you like to use?", Generic, LogglySyslog, LogglyHttp, "Quit")) 36 | { 37 | case Generic: 38 | var genOptions = new Options 39 | { 40 | HostNameOrIp = ConsoleUtility.Question("What is the Host Name or IP of your Syslog Server?"), 41 | Port = ConsoleUtility.Question("What is the port your Syslog Server is listening on?"), 42 | AppNameOrTag = "LoggingDemo" 43 | }; 44 | 45 | return new SyslogLogger(genOptions); 46 | case LogglySyslog: 47 | return new LogglySyslogLogger(GetLogglyOptions()); 48 | case LogglyHttp: 49 | return new LogglyHttpLogger(GetLogglyOptions()); 50 | case "Quit": 51 | break; 52 | default: 53 | Console.WriteLine("You selected a bad option"); 54 | break; 55 | } 56 | 57 | Continue = false; 58 | return null; 59 | } 60 | 61 | private static ILogglyOptions GetLogglyOptions() => 62 | new LogglyOptions 63 | { 64 | AppName = "LoggingDemo", 65 | Token = ConsoleUtility.Question("What is your Loggly Token?") 66 | }; 67 | } 68 | 69 | public class Options : ISyslogOptions 70 | { 71 | public string HostNameOrIp { get; set; } 72 | 73 | public int? Port { get; set; } 74 | 75 | public string AppNameOrTag { get; set; } 76 | } 77 | 78 | public class LogglyOptions : ILogglyOptions 79 | { 80 | public string Token { get; set; } 81 | 82 | public string AppName { get; set; } 83 | 84 | public IEnumerable Tags => new string[] 85 | { 86 | "http", 87 | "test" 88 | }; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with you package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); 20 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.Content.PM; 5 | using Android.Runtime; 6 | using Android.Views; 7 | using Android.Widget; 8 | using Android.OS; 9 | 10 | namespace SampleApp.Droid 11 | { 12 | [Activity(Label = "SampleApp", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 13 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity 14 | { 15 | protected override void OnCreate(Bundle savedInstanceState) 16 | { 17 | TabLayoutResource = Resource.Layout.Tabbar; 18 | ToolbarResource = Resource.Layout.Toolbar; 19 | 20 | base.OnCreate(savedInstanceState); 21 | global::Xamarin.Forms.Forms.Init(this, savedInstanceState); 22 | LoadApplication(new App()); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("SampleApp.Android")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("SampleApp.Android")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | 32 | // Add some common permissions, these can be removed if not needed 33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)] 34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] 35 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.xml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable-hdpi/ 12 | icon.png 13 | 14 | drawable-ldpi/ 15 | icon.png 16 | 17 | drawable-mdpi/ 18 | icon.png 19 | 20 | layout/ 21 | main.xml 22 | 23 | values/ 24 | strings.xml 25 | 26 | In order to get the build system to recognize Android resources, set the build action to 27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 28 | instead operate on resource IDs. When you compile an Android application that uses resources, 29 | the build system will package the resources for distribution and generate a class called 30 | "Resource" that contains the tokens for each one of the resources included. For example, 31 | for the above Resources layout, this is what the Resource class would expose: 32 | 33 | public class Resource { 34 | public class drawable { 35 | public const int icon = 0x123; 36 | } 37 | 38 | public class layout { 39 | public const int main = 0x456; 40 | } 41 | 42 | public class strings { 43 | public const int first_string = 0xabc; 44 | public const int second_string = 0xbcd; 45 | } 46 | } 47 | 48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main 49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first 50 | string in the dictionary file values/strings.xml. 51 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/layout/Tabbar.axml: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/layout/Toolbar.axml: -------------------------------------------------------------------------------- 1 | 9 | 10 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/mipmap-anydpi-v26/icon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/mipmap-anydpi-v26/icon_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/mipmap-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.Android/Resources/mipmap-hdpi/icon.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/mipmap-hdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.Android/Resources/mipmap-hdpi/launcher_foreground.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/mipmap-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.Android/Resources/mipmap-mdpi/icon.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/mipmap-mdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.Android/Resources/mipmap-mdpi/launcher_foreground.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/mipmap-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.Android/Resources/mipmap-xhdpi/icon.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/mipmap-xhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.Android/Resources/mipmap-xhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/mipmap-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.Android/Resources/mipmap-xxhdpi/icon.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/mipmap-xxhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.Android/Resources/mipmap-xxhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/mipmap-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.Android/Resources/mipmap-xxxhdpi/icon.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | #3F51B5 5 | #303F9F 6 | #FF4081 7 | 8 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.Android/Resources/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/LargeTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/LargeTile.scale-100.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/LargeTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/LargeTile.scale-200.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/LargeTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/LargeTile.scale-400.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/SmallTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/SmallTile.scale-100.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/SmallTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/SmallTile.scale-200.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/SmallTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/SmallTile.scale-400.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.targetsize-16.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.targetsize-256.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/StoreLogo.backup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/StoreLogo.backup.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/StoreLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/StoreLogo.scale-200.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/StoreLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/StoreLogo.scale-400.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Assets/Wide310x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.UWP/Assets/Wide310x150Logo.scale-400.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | 16 | namespace SampleApp.UWP 17 | { 18 | public sealed partial class MainPage 19 | { 20 | public MainPage() 21 | { 22 | this.InitializeComponent(); 23 | 24 | LoadApplication(new SampleApp.App()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | SampleApp.UWP 18 | 94b55993-2d7b-4ffb-841d-2859a58f6f50 19 | Assets\StoreLogo.png 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SampleApp.UWP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SampleApp.UWP")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.UWP/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace SampleApp.iOS 9 | { 10 | // The UIApplicationDelegate for the application. This class is responsible for launching the 11 | // User Interface of the application, as well as listening (and optionally responding) to 12 | // application events from iOS. 13 | [Register("AppDelegate")] 14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate 15 | { 16 | // 17 | // This method is invoked when the application has loaded and is ready to run. In this 18 | // method you should instantiate the window, load the UI into it and then make the window 19 | // visible. 20 | // 21 | // You have 17 seconds to return from this method, or iOS will terminate your application. 22 | // 23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 24 | { 25 | global::Xamarin.Forms.Forms.Init(); 26 | LoadApplication(new App()); 27 | 28 | return base.FinishedLaunching(app, options); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "scale": "2x", 5 | "size": "20x20", 6 | "idiom": "iphone", 7 | "filename": "Icon40.png" 8 | }, 9 | { 10 | "scale": "3x", 11 | "size": "20x20", 12 | "idiom": "iphone", 13 | "filename": "Icon60.png" 14 | }, 15 | { 16 | "scale": "2x", 17 | "size": "29x29", 18 | "idiom": "iphone", 19 | "filename": "Icon58.png" 20 | }, 21 | { 22 | "scale": "3x", 23 | "size": "29x29", 24 | "idiom": "iphone", 25 | "filename": "Icon87.png" 26 | }, 27 | { 28 | "scale": "2x", 29 | "size": "40x40", 30 | "idiom": "iphone", 31 | "filename": "Icon80.png" 32 | }, 33 | { 34 | "scale": "3x", 35 | "size": "40x40", 36 | "idiom": "iphone", 37 | "filename": "Icon120.png" 38 | }, 39 | { 40 | "scale": "2x", 41 | "size": "60x60", 42 | "idiom": "iphone", 43 | "filename": "Icon120.png" 44 | }, 45 | { 46 | "scale": "3x", 47 | "size": "60x60", 48 | "idiom": "iphone", 49 | "filename": "Icon180.png" 50 | }, 51 | { 52 | "scale": "1x", 53 | "size": "20x20", 54 | "idiom": "ipad", 55 | "filename": "Icon20.png" 56 | }, 57 | { 58 | "scale": "2x", 59 | "size": "20x20", 60 | "idiom": "ipad", 61 | "filename": "Icon40.png" 62 | }, 63 | { 64 | "scale": "1x", 65 | "size": "29x29", 66 | "idiom": "ipad", 67 | "filename": "Icon29.png" 68 | }, 69 | { 70 | "scale": "2x", 71 | "size": "29x29", 72 | "idiom": "ipad", 73 | "filename": "Icon58.png" 74 | }, 75 | { 76 | "scale": "1x", 77 | "size": "40x40", 78 | "idiom": "ipad", 79 | "filename": "Icon40.png" 80 | }, 81 | { 82 | "scale": "2x", 83 | "size": "40x40", 84 | "idiom": "ipad", 85 | "filename": "Icon80.png" 86 | }, 87 | { 88 | "scale": "1x", 89 | "size": "76x76", 90 | "idiom": "ipad", 91 | "filename": "Icon76.png" 92 | }, 93 | { 94 | "scale": "2x", 95 | "size": "76x76", 96 | "idiom": "ipad", 97 | "filename": "Icon152.png" 98 | }, 99 | { 100 | "scale": "2x", 101 | "size": "83.5x83.5", 102 | "idiom": "ipad", 103 | "filename": "Icon167.png" 104 | }, 105 | { 106 | "scale": "1x", 107 | "size": "1024x1024", 108 | "idiom": "ios-marketing", 109 | "filename": "Icon1024.png" 110 | } 111 | ], 112 | "properties": {}, 113 | "info": { 114 | "version": 1, 115 | "author": "xcode" 116 | } 117 | } -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UISupportedInterfaceOrientations 11 | 12 | UIInterfaceOrientationPortrait 13 | UIInterfaceOrientationLandscapeLeft 14 | UIInterfaceOrientationLandscapeRight 15 | 16 | UISupportedInterfaceOrientations~ipad 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationPortraitUpsideDown 20 | UIInterfaceOrientationLandscapeLeft 21 | UIInterfaceOrientationLandscapeRight 22 | 23 | MinimumOSVersion 24 | 8.0 25 | CFBundleDisplayName 26 | SampleApp 27 | CFBundleIdentifier 28 | com.companyname.SampleApp 29 | CFBundleVersion 30 | 1.0 31 | UILaunchStoryboardName 32 | LaunchScreen 33 | CFBundleName 34 | SampleApp 35 | XSAppIconAssets 36 | Assets.xcassets/AppIcon.appiconset 37 | 38 | 39 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace SampleApp.iOS 9 | { 10 | public class Application 11 | { 12 | // This is the main entry point of the application. 13 | static void Main(string[] args) 14 | { 15 | // if you want to use a different Application Delegate class from "AppDelegate" 16 | // you can specify it here. 17 | UIApplication.Main(args, null, "AppDelegate"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SampleApp.iOS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SampleApp.iOS")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Resources/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Resources/Default-Portrait@2x.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Resources/Default.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp.iOS/Resources/Default@2x.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp.iOS/Resources/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/App.xaml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Collections/ObservableDictionary.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Collections.Specialized; 5 | using System.ComponentModel; 6 | using System.Linq; 7 | 8 | namespace SampleApp.Collections 9 | { 10 | public class ObservableDictionary : IDictionary, INotifyPropertyChanged, INotifyCollectionChanged 11 | { 12 | private Dictionary _collection = new Dictionary(); 13 | 14 | public TValue this[TKey key] 15 | { 16 | get => _collection[key]; 17 | set => Add(key, value); 18 | } 19 | 20 | public ICollection Keys => _collection.Keys; 21 | public ICollection Values => _collection.Values; 22 | public int Count => _collection.Count; 23 | public bool IsReadOnly => false; 24 | 25 | public event PropertyChangedEventHandler PropertyChanged; 26 | public event NotifyCollectionChangedEventHandler CollectionChanged; 27 | 28 | public void Add(TKey key, TValue value) 29 | { 30 | _collection.Add(key, value); 31 | CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add)); 32 | PropertyChanged(this, new PropertyChangedEventArgs(nameof(Count))); 33 | PropertyChanged(this, new PropertyChangedEventArgs(nameof(Keys))); 34 | PropertyChanged(this, new PropertyChangedEventArgs(nameof(Values))); 35 | } 36 | 37 | public void Add(KeyValuePair item) => 38 | Add(item.Key, item.Value); 39 | 40 | public void Clear() 41 | { 42 | _collection.Clear(); 43 | CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); 44 | PropertyChanged(this, new PropertyChangedEventArgs(nameof(Count))); 45 | PropertyChanged(this, new PropertyChangedEventArgs(nameof(Keys))); 46 | PropertyChanged(this, new PropertyChangedEventArgs(nameof(Values))); 47 | } 48 | 49 | public bool Contains(KeyValuePair item) => _collection.Contains(item); 50 | 51 | public bool ContainsKey(TKey key) => _collection.ContainsKey(key); 52 | 53 | public void CopyTo(KeyValuePair[] array, int arrayIndex) 54 | { 55 | throw new NotImplementedException(); 56 | } 57 | 58 | public IEnumerator> GetEnumerator() => _collection.GetEnumerator(); 59 | 60 | public bool Remove(TKey key) 61 | { 62 | var result = _collection.Remove(key); 63 | 64 | if (result) 65 | { 66 | CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove)); 67 | PropertyChanged(this, new PropertyChangedEventArgs(nameof(Count))); 68 | PropertyChanged(this, new PropertyChangedEventArgs(nameof(Keys))); 69 | PropertyChanged(this, new PropertyChangedEventArgs(nameof(Values))); 70 | } 71 | 72 | return result; 73 | } 74 | 75 | public bool Remove(KeyValuePair item) => Remove(item.Key); 76 | 77 | public bool TryGetValue(TKey key, out TValue value) => _collection.TryGetValue(key, out value); 78 | 79 | IEnumerator IEnumerable.GetEnumerator() => _collection.GetEnumerator(); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Events/LoggerType.cs: -------------------------------------------------------------------------------- 1 | namespace SampleApp.Events 2 | { 3 | public enum LoggerType 4 | { 5 | AppCenter, 6 | AppInsights, 7 | Graylog, 8 | LogglyHttp, 9 | LogglySyslog, 10 | Syslog 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Events/LoggerUpdatedEvent.cs: -------------------------------------------------------------------------------- 1 | using Prism.Events; 2 | using Prism.Logging; 3 | 4 | namespace SampleApp.Events 5 | { 6 | public class LoggerUpdatedEvent : PubSubEvent 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Events/UpdateLoggerEvent.cs: -------------------------------------------------------------------------------- 1 | using Prism.Events; 2 | 3 | namespace SampleApp.Events 4 | { 5 | public sealed class UpdateLoggerEvent : PubSubEvent 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Images/PrismLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dansiegel/Prism.Plugin.Logging/97b2432233ca8cbce6d7a08e42ab888dfde84493/sample/SampleApp/SampleApp/Images/PrismLogo.png -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/SampleApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | false 6 | 7 | 8 | 9 | pdbonly 10 | true 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Services/AppCenterConfig.cs: -------------------------------------------------------------------------------- 1 | using Prism.Mvvm; 2 | 3 | namespace SampleApp.Services 4 | { 5 | public class AppCenterConfig : BindableBase, IAppCenterConfig 6 | { 7 | private string _secret; 8 | public string Secret 9 | { 10 | get => _secret; 11 | set => SetProperty(ref _secret, value); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Services/AppInsightsConfig.cs: -------------------------------------------------------------------------------- 1 | using Prism.Logging.AppInsights; 2 | using Prism.Mvvm; 3 | using SampleApp.Collections; 4 | using System.Collections.Generic; 5 | 6 | namespace SampleApp.Services 7 | { 8 | public class AppInsightsConfig : BindableBase, IAppInsightsConfig, IApplicationInsightsOptions 9 | { 10 | private string _instrumentationKey; 11 | public string InstrumentationKey 12 | { 13 | get => _instrumentationKey; 14 | set => SetProperty(ref _instrumentationKey, value); 15 | } 16 | 17 | private readonly ObservableDictionary _userTraits = new ObservableDictionary(); 18 | public IDictionary UserTraits 19 | { 20 | get => _userTraits; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Services/GelfConfig.cs: -------------------------------------------------------------------------------- 1 | using Prism.Logging.Graylog; 2 | using Prism.Mvvm; 3 | using System; 4 | 5 | namespace SampleApp.Services 6 | { 7 | public class GelfConfig : BindableBase, IGelfConfig, IGelfOptions 8 | { 9 | private Uri _host; 10 | public Uri Host 11 | { 12 | get => _host; 13 | set => SetProperty(ref _host, value); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Services/IAppCenterConfig.cs: -------------------------------------------------------------------------------- 1 | namespace SampleApp.Services 2 | { 3 | public interface IAppCenterConfig 4 | { 5 | string Secret { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Services/IAppInsightsConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SampleApp.Services 4 | { 5 | public interface IAppInsightsConfig 6 | { 7 | string InstrumentationKey { get; set; } 8 | IDictionary UserTraits { get; } 9 | } 10 | } -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Services/IGelfConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SampleApp.Services 4 | { 5 | public interface IGelfConfig 6 | { 7 | Uri Host { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Services/ILogglyConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace SampleApp.Services 4 | { 5 | public interface ILogglyConfig 6 | { 7 | string AppName { get; set; } 8 | ObservableCollection Tags { get; } 9 | string Token { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Services/ISyslogConfig.cs: -------------------------------------------------------------------------------- 1 | using Prism.Logging.Syslog; 2 | 3 | namespace SampleApp.Services 4 | { 5 | public interface ISyslogConfig 6 | { 7 | string AppNameOrTag { get; set; } 8 | string HostNameOrIp { get; set; } 9 | int? Port { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Services/LogglyConfig.cs: -------------------------------------------------------------------------------- 1 | using Prism.Logging.Loggly; 2 | using Prism.Mvvm; 3 | using System.Collections.Generic; 4 | using System.Collections.ObjectModel; 5 | 6 | namespace SampleApp.Services 7 | { 8 | public class LogglyConfig : BindableBase, ILogglyConfig, ILogglyOptions 9 | { 10 | private string _token; 11 | public string Token 12 | { 13 | get => _token; 14 | set => SetProperty(ref _token, value); 15 | } 16 | 17 | private string _appName; 18 | public string AppName 19 | { 20 | get => _appName; 21 | set => SetProperty(ref _appName, value); 22 | } 23 | 24 | public ObservableCollection Tags { get; } = new ObservableCollection(); 25 | 26 | IEnumerable ILogglyOptions.Tags => Tags; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Services/SyslogConfig.cs: -------------------------------------------------------------------------------- 1 | using Prism.Logging.Syslog; 2 | using Prism.Mvvm; 3 | 4 | namespace SampleApp.Services 5 | { 6 | public class SyslogConfig : BindableBase, ISyslogOptions, ISyslogConfig 7 | { 8 | private string _hostOrIp; 9 | public string HostNameOrIp 10 | { 11 | get => _hostOrIp; 12 | set => SetProperty(ref _hostOrIp, value); 13 | } 14 | 15 | private int? _port; 16 | public int? Port 17 | { 18 | get => _port; 19 | set => SetProperty(ref _port, value); 20 | } 21 | 22 | private string _appName; 23 | public string AppNameOrTag 24 | { 25 | get => _appName; 26 | set => SetProperty(ref _appName, value); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/ViewModels/AppCenterConfigPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using Prism.Events; 2 | using Prism.Mvvm; 3 | using SampleApp.Services; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace SampleApp.ViewModels 9 | { 10 | public class AppCenterConfigPageViewModel : ConfigViewModelBase 11 | { 12 | public AppCenterConfigPageViewModel(IAppCenterConfig config, IEventAggregator eventAggregator) 13 | : base(config, eventAggregator) 14 | { 15 | LoggerType = Events.LoggerType.AppCenter; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/ViewModels/AppInsightsConfigPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using Prism.Events; 2 | using SampleApp.Services; 3 | 4 | namespace SampleApp.ViewModels 5 | { 6 | public class AppInsightsConfigPageViewModel : ConfigViewModelBase 7 | { 8 | public AppInsightsConfigPageViewModel(IAppInsightsConfig config, IEventAggregator eventAggregator) 9 | : base(config, eventAggregator) 10 | { 11 | LoggerType = Events.LoggerType.AppInsights; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/ViewModels/ConfigViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using Prism.Commands; 2 | using Prism.Events; 3 | using Prism.Mvvm; 4 | using SampleApp.Events; 5 | 6 | namespace SampleApp.ViewModels 7 | { 8 | public class ConfigViewModelBase : BindableBase 9 | { 10 | protected IEventAggregator EventAggregator { get; } 11 | 12 | public ConfigViewModelBase(T config, IEventAggregator eventAggregator) 13 | { 14 | Config = config; 15 | EventAggregator = eventAggregator; 16 | 17 | UpdateLoggerCommand = new DelegateCommand(OnUpdateLoggerCommandExecuted); 18 | } 19 | 20 | public T Config { get; } 21 | 22 | private LoggerType _loggerType; 23 | public LoggerType LoggerType 24 | { 25 | get => _loggerType; 26 | set => SetProperty(ref _loggerType, value); 27 | } 28 | 29 | public DelegateCommand UpdateLoggerCommand { get; } 30 | 31 | private void OnUpdateLoggerCommandExecuted() 32 | { 33 | EventAggregator.GetEvent().Publish(LoggerType); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/ViewModels/GelfConfigPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using Prism.Events; 2 | using SampleApp.Services; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace SampleApp.ViewModels 8 | { 9 | public class GelfConfigPageViewModel : ConfigViewModelBase 10 | { 11 | public GelfConfigPageViewModel(IGelfConfig config, IEventAggregator eventAggregator) 12 | : base(config, eventAggregator) 13 | { 14 | LoggerType = Events.LoggerType.Graylog; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/ViewModels/LogGeneratorPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using Prism.Commands; 2 | using Prism.Logging; 3 | using Prism.Mvvm; 4 | using SampleApp.Collections; 5 | using System; 6 | using System.Collections.Generic; 7 | using DryIoc; 8 | using Prism.Navigation; 9 | using Prism.Events; 10 | using SampleApp.Events; 11 | 12 | namespace SampleApp.ViewModels 13 | { 14 | public class LogGeneratorPageViewModel : BindableBase 15 | { 16 | private ILogger _logger; 17 | 18 | public LogGeneratorPageViewModel(IEventAggregator eventAggregator, ILogger logger) 19 | { 20 | _logger = logger; 21 | eventAggregator.GetEvent().Subscribe(OnLoggerUpdated); 22 | Properties = new ObservableDictionary(); 23 | 24 | TestAnalyticsCommand = new DelegateCommand(OnTestAnalyticsCommandExecuted); 25 | TestCrashCommand = new DelegateCommand(OnTestCrashCommandExecuted); 26 | TestLogCommand = new DelegateCommand(OnTestLogCommandExecuted); 27 | } 28 | 29 | private void OnLoggerUpdated(ILogger logger) 30 | { 31 | _logger = logger; 32 | } 33 | 34 | private string _message; 35 | public string Message 36 | { 37 | get => _message; 38 | set => SetProperty(ref _message, value); 39 | } 40 | 41 | public ObservableDictionary Properties { get; } 42 | 43 | public DelegateCommand TestAnalyticsCommand { get; } 44 | 45 | public DelegateCommand TestCrashCommand { get; } 46 | 47 | public DelegateCommand TestLogCommand { get; } 48 | 49 | private void OnTestAnalyticsCommandExecuted() 50 | { 51 | _logger.TrackEvent("User Defined Event"); 52 | } 53 | 54 | private void OnTestCrashCommandExecuted() 55 | { 56 | try 57 | { 58 | throw new Exception("This is a test crash..."); 59 | } 60 | catch (Exception ex) 61 | { 62 | _logger.Report(ex, new Dictionary { { "caller", nameof(OnTestCrashCommandExecuted) } }); 63 | } 64 | } 65 | 66 | private void OnTestLogCommandExecuted() 67 | { 68 | _logger.Log(Message); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/ViewModels/LogglyConfigPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using Prism.Events; 2 | using SampleApp.Services; 3 | using SampleApp.Events; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using Prism.Commands; 8 | 9 | namespace SampleApp.ViewModels 10 | { 11 | public class LogglyConfigPageViewModel : ConfigViewModelBase 12 | { 13 | public LogglyConfigPageViewModel(ILogglyConfig config, IEventAggregator eventAggregator) 14 | : base(config, eventAggregator) 15 | { 16 | LoggerType = LoggerType.LogglyHttp; 17 | AddTagCommand = new DelegateCommand(OnAddTagCommandExecuted); 18 | } 19 | 20 | public string[] Modes { get; } = new string[] { "Http", "Syslog" }; 21 | 22 | private string _selectedMode = "Http"; 23 | public string SelectedMode 24 | { 25 | get => _selectedMode; 26 | set => SetProperty(ref _selectedMode, value, () => LoggerType = value == "Http" ? LoggerType.LogglyHttp : LoggerType.LogglySyslog); 27 | } 28 | 29 | public DelegateCommand AddTagCommand { get; } 30 | 31 | private void OnAddTagCommandExecuted(string tag) 32 | { 33 | Config.Tags.Add(tag); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/ViewModels/SyslogConfigPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using Prism.Events; 2 | using SampleApp.Services; 3 | 4 | namespace SampleApp.ViewModels 5 | { 6 | public class SyslogConfigPageViewModel : ConfigViewModelBase 7 | { 8 | public SyslogConfigPageViewModel(ISyslogConfig config, IEventAggregator eventAggregator) 9 | : base(config, eventAggregator) 10 | { 11 | LoggerType = Events.LoggerType.Syslog; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sample/SampleApp/SampleApp/Views/AppCenterConfigPage.xaml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 8 |