Skip to content

Logging in commands#68

Merged
technoweenie merged 4 commits intomasterfrom
logging-in-commands
Jun 5, 2014
Merged

Logging in commands#68
technoweenie merged 4 commits intomasterfrom
logging-in-commands

Conversation

@technoweenie
Copy link
Contributor

Moves the logging to the commands package. Need to review the changes to the core gitmedia package carefully. We want more idiomatic Go code that returns errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created some special error types: gitmedia.NotInARepositoryError and *gitmedia.HookExists.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooh, nice

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to get rid of this too. It's in init(), so it'll be more difficult.

technoweenie added a commit that referenced this pull request Jun 5, 2014
@technoweenie technoweenie merged commit 5467466 into master Jun 5, 2014
@technoweenie technoweenie deleted the logging-in-commands branch June 5, 2014 21:26
chrisd8088 added a commit to chrisd8088/git-lfs that referenced this pull request Feb 12, 2025
In PR git-lfs#68 the "commands" package was updated with several logging
functions such as Panic(), Print(), and Debug().  The last of these
only outputs a log message if the Debugging variable in the same
package is set to "true", which at the time was controlled by the
setupDebugging() function.  If the user supplied the --debug option
to a given Git LFS command, setupDebugging() function would set the
Debugging variable to "true", and any calls to Debug() would then
generate log messages.

However, the setupDebugging() function was removed, along with a
lot of the earlier command-line parsing and setup code, in PR git-lfs#84,
and replaced with the Cobra library from the spf13/cobra project.
Since then it has not been possible to set the Debugging variable
to a value other than "false", so the remaining references to the
Debug() function will never generate log messages.

We therefore remove the Debugging variable and the Debug() function,
and replace any calls to that function with ones to our standard
trace logging function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants