Skip to content

Commit 519bed2

Browse files
authored
Merge pull request #66 from geekwhocodes/dev
Docs website
2 parents 54d4d9f + 63249c9 commit 519bed2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+11987
-2
lines changed

docs/index.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

website/.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
21+
22+
.vscode

website/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Ganesh Raskar
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

website/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Website
2+
3+
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
```
30+
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
31+
```
32+
33+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

website/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

website/blog/2020-07-06-v1.0.0.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
id: release-v1.0.0
3+
title: SimplePSLogger V1.0.0
4+
author: Ganesh Raskar
5+
author_title: Azure Consultant @rapidcircle
6+
author_url: https://github.com/geekwhocodes
7+
author_image_url: https://avatars1.githubusercontent.com/u/10639200?s=460&u=37ca79e81c11cea6f3611f457570ab2976097c65&v=4
8+
tags: [intro]
9+
---
10+
11+
### ``` Install-Module -Name SimplePSLogger```
12+
[SimplePSLogger](https://www.powershellgallery.com/packages/SimplePSLogger/1.0.0)
13+
14+
15+
**Added**
16+
- Added Azure Log Analytics logging provider ⭐
17+
- Added feature to register external providers. Bring your own logger 🔥
18+
- Added Tests 💜
19+
- Added documentation
20+
21+
**Removed**
22+
- NA
23+
24+
**Bug Fixes**
25+
- Minor fixes
26+
27+
**Known Issues**
28+
- https://spsl.geekwhocodes.me/known-issues

website/docs/configurations.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: Configurations
3+
id: configurations
4+
description: SimplePSLogger configutation
5+
keywords:
6+
- logging
7+
- SimplePSLogger
8+
---
9+
10+
Configure it your way 🤘
11+
12+
SimplePSLogger support's multiple [**Logging Providers**](providers.md) and each provider has it's own configuration properties which you can configure. This gives provider writers an ability to create more powerful and robust providers. You can find configurable properties for each provider on provider's page under **```Configuration```** section.
13+
14+
15+
### Sample Configuration Object
16+
17+
```powershell
18+
$SimplePSLoggerConfig = @{
19+
Name = "Your-Logger-Name" # You can configure this name using -Name parameter too
20+
Providers = @{
21+
Console = @{
22+
Enabled = $true
23+
LogLevel = "verbose"
24+
}
25+
File = @{
26+
LiteralFilePath = "literal\path\file.log"
27+
LogLevel = "information"
28+
Enabled = $true
29+
}
30+
}
31+
}
32+
```
33+
34+
You can configure logger name in your configuration object using **Name** property.
35+
Configuration object has **```Providers```** section which contains provider specific configurations.
36+
Example - in above example we have configured Console and File logging providers respectively.
37+
38+
:::tip
39+
Each provider has default **Enabled** and **LogLevel** properties. You can configure them as per your needs.
40+
:::
41+
42+
43+
The name of configuration section follows naming convention: if logging provider's name is **```SimplePSLogger.XYZ```** then you use **```XYZ```** name in configuration object. In above example, we used **```File```** name to configure **```SimplePSLogger.File```** provider. You can find more information on how to configure specific provider under it's own page under [Providers](providers.md) or Custome Providers documentation.
44+
45+
### Log Message Format
46+
47+
SimplePSLogger use following log message format -
48+
UTC-Timestamp[space]logger-name[space]loglevel[space]Log message
49+
:::info
50+
UTC Timestamp format : yyyy/MM/dd HH:mm:ss:ffff tt
51+
:::
52+
![sample-logs-image](/img/providers/simplepslogger.console.png)
53+
54+
55+
56+
:::note
57+
*Each provider can have their own log message format*
58+
:::

website/docs/contributing.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Contributing
3+
id: contributing
4+
---
5+
6+
Comming soon
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Custom Provider Registration
3+
id: custom-provider-registration
4+
description: "Registering SimplePSLogger Custom Logging Provider"
5+
keywords:
6+
- simple-ps-logger
7+
- powershell core
8+
- powershell logging
9+
- pscore
10+
- SimplePSLogger
11+
- geekwhocodes
12+
---
13+
14+
We assume that you have successfully create custom logging provider by following [writing custom provider](writing-custom-provider.md). Let's register it so that you can use it.
15+
16+
### Steps
17+
- Import SimplePSLogger module
18+
- Import your custom logging provider module
19+
- Create SimplePSLogger instance
20+
- Register your provider using .Register method
21+
22+
23+
### Registration
24+
25+
```powershell {30}
26+
# 1. Import SimplePSLogger module
27+
Import-Module -Name SimplePSLogger
28+
# 2. Import your custom logging provider module
29+
Import-Module -Name CustomeLoggingProvider
30+
# Create SimplePSLogger configuration
31+
$SimplePSLoggerConfig = @{
32+
Name = "config-example"
33+
Providers = @{
34+
Console = @{
35+
LogLevel = "verbose"
36+
Enabled = $false
37+
}
38+
File = @{
39+
LiteralFilePath = "G:\Git\simple-ps-logger\Examples\example-with-config-file\example-with-config.log"
40+
LogLevel = "information"
41+
Enabled = $false
42+
}
43+
AwesomeLogger = @{
44+
Enabled = $true
45+
LogLevel = "information"
46+
Authkey = "key"
47+
}
48+
}
49+
}
50+
51+
# 3. Create SimplePSLogger instance
52+
$MyLogger = New-SimplePSLogger -Name "ps-play"
53+
54+
# 4. Register your provider using .Register method. MAKE SURE function named "ExtProvider" is imported
55+
$MyLogger.RegisterProvider("AwesomeLogger", "ExtProvider", $SimplePSLoggerConfig.Providers["AwesomeLogger"])
56+
57+
58+
$MyLogger.Log("test")
59+
```
60+
61+
### Registration Paramters
62+
63+
1. Customer Logging Provider Name
64+
2. Exported function name which implements [SimplePSLogger Provider Interface](writing-custom-provider.md#SimplePSLogger-Provider-Interface)
65+
3. Configuration object required/defined by custom provider
66+
67+
68+
<br/>
69+
70+
If you are facing problems, tweet me at [@_ganesh_raskar](https://twitter.com/_ganesh_raskar)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
id: custom-providers-intro
3+
title: Custom Providers Introduction
4+
---
5+
6+
> #### Bring your own logger
7+
8+
SimplePSLogger comes with few commonly used providers, however if you would like display or store logs in custom dimensions/schema or format then custom provider provides a way to register your provider.

0 commit comments

Comments
 (0)