Skip to content

Commit b9011bf

Browse files
committed
refactor(log): rename NotificationLevel::Debug to Trace and Verbose to Debug
1 parent 36657c7 commit b9011bf

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

src/cli/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl Notifier {
155155
let level = n.level();
156156
for n in format!("{n}").lines() {
157157
match level {
158-
NotificationLevel::Verbose => {
158+
NotificationLevel::Debug => {
159159
if self.verbose {
160160
debug!("{}", n);
161161
}
@@ -169,7 +169,7 @@ impl Notifier {
169169
NotificationLevel::Error => {
170170
error!("{}", n);
171171
}
172-
NotificationLevel::Debug => {
172+
NotificationLevel::Trace => {
173173
trace!("{}", n);
174174
}
175175
}

src/cli/log.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ where
107107
impl NotificationLevel {
108108
fn fg_color(&self) -> Option<Color> {
109109
match self {
110-
NotificationLevel::Debug => Some(Color::Blue),
111-
NotificationLevel::Verbose => Some(Color::Magenta),
110+
NotificationLevel::Trace => Some(Color::Blue),
111+
NotificationLevel::Debug => Some(Color::Magenta),
112112
NotificationLevel::Info => None,
113113
NotificationLevel::Warn => Some(Color::Yellow),
114114
NotificationLevel::Error => Some(Color::Red),

src/dist/notifications.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<'a> Notification<'a> {
6060
ChecksumValid(_)
6161
| NoUpdateHash(_)
6262
| FileAlreadyDownloaded
63-
| DownloadingLegacyManifest => NotificationLevel::Verbose,
63+
| DownloadingLegacyManifest => NotificationLevel::Debug,
6464
Extracting(_, _)
6565
| DownloadingComponent(_, _, _)
6666
| InstallingComponent(_, _, _)

src/dist/temp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ impl<'a> Notification<'a> {
8383
pub(crate) fn level(&self) -> NotificationLevel {
8484
use self::Notification::*;
8585
match self {
86-
CreatingRoot(_) | CreatingFile(_) | CreatingDirectory(_) => NotificationLevel::Verbose,
86+
CreatingRoot(_) | CreatingFile(_) | CreatingDirectory(_) => NotificationLevel::Debug,
8787
FileDeletion(_, result) | DirectoryDeletion(_, result) => {
8888
if result.is_ok() {
89-
NotificationLevel::Verbose
89+
NotificationLevel::Debug
9090
} else {
9191
NotificationLevel::Warn
9292
}

src/notifications.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<'a> Notification<'a> {
6868
| UpdatingToolchain(_)
6969
| ReadMetadataVersion(_)
7070
| InstalledToolchain(_)
71-
| UpdateHashMatches => NotificationLevel::Verbose,
71+
| UpdateHashMatches => NotificationLevel::Debug,
7272
SetDefaultToolchain(_)
7373
| SetOverrideToolchain(_, _)
7474
| SetProfile(_)

src/utils/notifications.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl<'a> Notification<'a> {
4646
pub(crate) fn level(&self) -> NotificationLevel {
4747
use self::Notification::*;
4848
match self {
49-
SetDefaultBufferSize(_) => NotificationLevel::Debug,
49+
SetDefaultBufferSize(_) => NotificationLevel::Trace,
5050
CreatingDirectory(_, _)
5151
| RemovingDirectory(_, _)
5252
| LinkingDirectory(_, _)
@@ -59,7 +59,7 @@ impl<'a> Notification<'a> {
5959
| DownloadFinished
6060
| ResumingPartialDownload
6161
| UsingCurl
62-
| UsingReqwest => NotificationLevel::Verbose,
62+
| UsingReqwest => NotificationLevel::Debug,
6363
RenameInUse(_, _) => NotificationLevel::Info,
6464
NoCanonicalPath(_) => NotificationLevel::Warn,
6565
Error(_) => NotificationLevel::Error,

src/utils/notify.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use tracing::Level;
44

55
#[derive(Debug)]
66
pub(crate) enum NotificationLevel {
7+
Trace,
78
Debug,
8-
Verbose,
99
Info,
1010
Warn,
1111
Error,
@@ -14,8 +14,8 @@ pub(crate) enum NotificationLevel {
1414
impl fmt::Display for NotificationLevel {
1515
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> fmt::Result {
1616
f.write_str(match self {
17+
NotificationLevel::Trace => "trace",
1718
NotificationLevel::Debug => "debug",
18-
NotificationLevel::Verbose => "verbose",
1919
NotificationLevel::Info => "info",
2020
NotificationLevel::Warn => "warning",
2121
NotificationLevel::Error => "error",
@@ -26,8 +26,8 @@ impl fmt::Display for NotificationLevel {
2626
impl From<Level> for NotificationLevel {
2727
fn from(level: Level) -> Self {
2828
match level {
29-
Level::TRACE => Self::Debug,
30-
Level::DEBUG => Self::Verbose,
29+
Level::TRACE => Self::Trace,
30+
Level::DEBUG => Self::Debug,
3131
Level::INFO => Self::Info,
3232
Level::WARN => Self::Warn,
3333
Level::ERROR => Self::Error,

0 commit comments

Comments
 (0)