-
Notifications
You must be signed in to change notification settings - Fork 240
Improved some logging messages and --log-level NONE behavior #2845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 15 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
c844cc8
Improve logging
dphulkar-msft 4d3bf87
When --log-level is set to NONE avoid display the 'Log file located' …
dphulkar-msft ba4848c
Merge branch 'main' of https://github.com/Azure/azure-storage-azcopy …
dphulkar-msft 514eb06
--log-level flag help details should also show DEBUG option
dphulkar-msft cd89e2c
Merge branch 'main' into dphulkar/improveLogging
wonwuakpa-msft 87e494c
Merge branch 'main' of https://github.com/Azure/azure-storage-azcopy …
dphulkar-msft 4e6e3f0
Merge branch 'dphulkar/improveLogging' of https://github.com/Azure/az…
dphulkar-msft 2bc49d3
Added a test to test the workflow of --log-level NONE flag
dphulkar-msft 611593c
Merge branch 'main' of https://github.com/Azure/azure-storage-azcopy …
dphulkar-msft 259aa1d
Added test for --log-level NONE
dphulkar-msft 6d55250
Added test
dphulkar-msft d5e3140
Merge branch 'main' of https://github.com/Azure/azure-storage-azcopy …
dphulkar-msft e7942ad
Merge branch 'main' of https://github.com/Azure/azure-storage-azcopy …
dphulkar-msft 0da2542
Merge branch 'dphulkar/improveLogging' of https://github.com/Azure/az…
dphulkar-msft 48e902d
Merge branch 'main' into dphulkar/improveLogging
wonwuakpa-msft 27fde7d
Merge branch 'main' of https://github.com/Azure/azure-storage-azcopy …
dphulkar-msft 460f15a
Merge branch 'main' of https://github.com/Azure/azure-storage-azcopy …
dphulkar-msft cc850e8
Merge branch 'dphulkar/improveLogging' of https://github.com/Azure/az…
dphulkar-msft d6ff873
Added E2E test
dphulkar-msft e01b23a
Merge branch 'main' of https://github.com/Azure/azure-storage-azcopy …
dphulkar-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,94 @@ | ||
// Copyright © Microsoft <[email protected]> | ||
// | ||
// 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: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// 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. | ||
|
||
package e2etest | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"github.com/Azure/azure-storage-azcopy/v10/common" | ||
) | ||
|
||
func init() { | ||
suiteManager.RegisterSuite(&FlagsFunctionalitySuite{}) | ||
} | ||
|
||
type FlagsFunctionalitySuite struct{} | ||
|
||
// @brief This test verifies that when the --log-level is set to NONE, | ||
// AzCopy does not display the "Log files located" message on the console. | ||
func (s *FlagsFunctionalitySuite) Scenario_LogLevelNone(svm *ScenarioVariationManager) { | ||
azCopyVerb := ResolveVariation(svm, []AzCopyVerb{AzCopyVerbCopy, AzCopyVerbSync}) // Calculate verb early to create the destination object early | ||
// Scale up from service to object | ||
dstObj := CreateResource[ContainerResourceManager](svm, GetRootResource(svm, ResolveVariation(svm, []common.Location{common.ELocation.Local(), common.ELocation.Blob(), common.ELocation.File(), common.ELocation.BlobFS()})), ResourceDefinitionContainer{}).GetObject(svm, "test", common.EEntityType.File()) | ||
|
||
// The object must exist already if we're syncing. | ||
if azCopyVerb == AzCopyVerbSync { | ||
dstObj.Create(svm, NewZeroObjectContentContainer(0), ObjectProperties{}) | ||
|
||
if !svm.Dryrun() { | ||
// Make sure the LMT is in the past | ||
time.Sleep(time.Second * 10) | ||
} | ||
} | ||
|
||
body := NewRandomObjectContentContainer(SizeFromString("10K")) | ||
// Scale up from service to object | ||
srcObj := CreateResource[ObjectResourceManager](svm, GetRootResource(svm, ResolveVariation(svm, []common.Location{common.ELocation.Local(), common.ELocation.Blob(), common.ELocation.File(), common.ELocation.BlobFS()})), ResourceDefinitionObject{ | ||
ObjectName: pointerTo("test"), | ||
Body: body, | ||
}) | ||
|
||
// no local->local | ||
if srcObj.Location().IsLocal() && dstObj.Location().IsLocal() { | ||
svm.InvalidateScenario() | ||
return | ||
} | ||
|
||
sasOpts := GenericAccountSignatureValues{} | ||
logLevel := common.LogLevel.None(common.LogNone) | ||
|
||
stdOut, _ := RunAzCopy( | ||
svm, | ||
AzCopyCommand{ | ||
Verb: azCopyVerb, | ||
Targets: []ResourceManager{ | ||
TryApplySpecificAuthType(srcObj, EExplicitCredentialType.SASToken(), svm, CreateAzCopyTargetOptions{ | ||
SASTokenOptions: sasOpts, | ||
}), | ||
TryApplySpecificAuthType(dstObj, EExplicitCredentialType.SASToken(), svm, CreateAzCopyTargetOptions{ | ||
SASTokenOptions: sasOpts, | ||
}), | ||
}, | ||
Flags: CopyFlags{ | ||
CopySyncCommonFlags: CopySyncCommonFlags{ | ||
Recursive: pointerTo(true), | ||
GlobalFlags: GlobalFlags{ | ||
LogLevel: &logLevel, | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
fmt.Println("================================================================") | ||
fmt.Println(stdOut) | ||
ValidateMessageOutput(svm, stdOut, "LogFileLocation", false) | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.