-
Notifications
You must be signed in to change notification settings - Fork 848
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move logging to log package (#15287)
- Loading branch information
1 parent
8cafe21
commit 25dbc53
Showing
5 changed files
with
77 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// +build go1.13 | ||
|
||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
// Package log provides functionality for configuring logging facilities. | ||
package log | ||
|
||
import ( | ||
"github.com/Azure/azure-sdk-for-go/sdk/internal/log" | ||
) | ||
|
||
// Classification is used to group entries. Each group can be toggled on or off. | ||
type Classification = log.Classification | ||
|
||
const ( | ||
// Request entries contain information about HTTP requests. | ||
// This includes information like the URL, query parameters, and headers. | ||
Request = log.Request | ||
|
||
// Response entries contain information about HTTP responses. | ||
// This includes information like the HTTP status code, headers, and request URL. | ||
Response = log.Response | ||
|
||
// RetryPolicy entries contain information specific to the retry policy in use. | ||
RetryPolicy = log.RetryPolicy | ||
|
||
// LongRunningOperation entries contain information specific to long-running operations. | ||
// This includes information like polling location, operation state and sleep intervals. | ||
LongRunningOperation = log.LongRunningOperation | ||
) | ||
|
||
// SetClassifications is used to control which classifications are written to | ||
// the log. By default all log classifications are writen. | ||
func SetClassifications(cls ...Classification) { | ||
log.SetClassifications(cls...) | ||
} | ||
|
||
// SetListener will set the Logger to write to the specified Listener. | ||
func SetListener(lst func(log.Classification, string)) { | ||
log.SetListener(lst) | ||
} | ||
|
||
// for testing purposes | ||
func resetClassifications() { | ||
log.TestResetClassifications() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters