Skip to content

Commit

Permalink
more simplifying
Browse files Browse the repository at this point in the history
  • Loading branch information
samdeane committed Sep 30, 2024
1 parent c3f2b32 commit a8eeae4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
9 changes: 5 additions & 4 deletions Extras/Examples/CommandLineExample/Sources/Example/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import Logger
let stdout = Logger.stdout

let test = Channel("test")
let test2 = Channel("com.elegantchaos.other.test2", handlers: [PrintHandler("print", showName: true, showSubsystem: true)])
let test2 = Channel(
"com.elegantchaos.other.test2",
handlers: [PrintHandler("print", showName: true, showSubsystem: true)])

stdout.log("This should get printed to stdout.")
stdout.log("There shouldn't be any contex information included in the output.\n")
Expand All @@ -18,8 +20,7 @@ test.log("This should get printed to the default console location.")
test.log("On the Mac it'll be the console. On Linux, currently, it's stdout.")
test.log("Unlike the Logger.stdout channel, this one also shows the channel name.\n\n")

test2.log("This should always be logged to stdout, but will show the console name and the subsystem.\n")
test2.log(
"This should always be logged to stdout, but will show the console name and the subsystem.\n")

stdout.debug("This should only appear for debug builds.\n")

Logger.defaultManager.flush()
11 changes: 0 additions & 11 deletions Sources/Logger/Manager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,6 @@ public actor Manager {
}
events.yield(.started)
}

/**
Pause until everything in the log queue has been logged.

You shouldn't generally need to do this, but it's helpful if you
need to ensure that all output reaches its destination before some
action (exiting, for example).
*/

public func flush() {
}
}

// MARK: Fatal Error Handling
Expand Down
9 changes: 5 additions & 4 deletions Sources/LoggerExample/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import Logger
let stdout = Logger.stdout

let test = Channel("test")
let test2 = Channel("com.elegantchaos.other.test2", handlers: [PrintHandler("print", showName: true, showSubsystem: true)])
let test2 = Channel(
"com.elegantchaos.other.test2",
handlers: [PrintHandler("print", showName: true, showSubsystem: true)])

stdout.log("This should get printed to stdout.")
stdout.log("There shouldn't be any contex information included in the output.\n")
Expand All @@ -18,8 +20,7 @@ test.log("This should get printed to the default console location.")
test.log("On the Mac it'll be the console. On Linux, currently, it's stdout.")
test.log("Unlike the Logger.stdout channel, this one also shows the channel name.\n\n")

test2.log("This should always be logged to stdout, but will show the console name and the subsystem.\n")
test2.log(
"This should always be logged to stdout, but will show the console name and the subsystem.\n")

stdout.debug("This should only appear for debug builds.\n")

Logger.defaultManager.flush()

0 comments on commit a8eeae4

Please sign in to comment.