Skip to content

Commit

Permalink
#618: minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Badgerati committed Nov 1, 2020
1 parent ce7ac21 commit a794a34
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions examples/web-pages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ Start-PodeServer -Threads 2 {
Set-PodeViewEngine -Type Pode

# wire up a custom logger
#TODO: can we remove this param, for a "$LogItem"?
$logType = New-PodeLoggingMethod -Custom -ScriptBlock {
param($item)
$item.HttpMethod | Out-Default
}

#TODO: can we remove this param, for a "$LogItem"?
$logType | Add-PodeLogger -Name 'custom' -ScriptBlock {
param($item)
return @{
Expand Down
3 changes: 0 additions & 3 deletions src/Private/Logging.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ function Start-PodeLoggingRunspace
}

# convert to log item into a writable format
#TODO: "$LogItem" ?
$_args = @($log.Item) + @($logger.Arguments)
if ($null -ne $logger.UsingVariables) {
$_args = @($logger.UsingVariables.Value) + $_args
Expand Down Expand Up @@ -326,7 +325,6 @@ function Start-PodeLoggingRunspace

# send the writable log item off to the log writer
if ($null -ne $result) {
#TODO: "$LogItem" ?
$_args = @(,$result) + @($logger.Method.Arguments)
if ($null -ne $logger.Method.UsingVariables) {
$_args = @($logger.Method.UsingVariables.Value) + $_args
Expand Down Expand Up @@ -357,7 +355,6 @@ function Test-PodeLoggerBatches
$result = $batch.Items
$batch.Items = @()

#TODO: "$LogItem" ?
$_args = @(,$result) + @($logger.Method.Arguments)
if ($null -ne $logger.Method.UsingVariables) {
$_args = @($logger.Method.UsingVariables.Value) + $_args
Expand Down
3 changes: 1 addition & 2 deletions src/Private/ServiceServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ function Start-PodeServiceServer
foreach ($name in $handlers.Keys) {
$handler = $handlers[$name]

#TODO: Remove $ServiceEvent from args
$_args = @($ServiceEvent) + @($handler.Arguments)
$_args = @($handler.Arguments)
if ($null -ne $handler.UsingVariables) {
$_args = @($handler.UsingVariables.Value) + $_args
}
Expand Down

0 comments on commit a794a34

Please sign in to comment.