Skip to content

Instantly share code, notes, and snippets.

@Juanpe
Created December 11, 2018 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Juanpe/61eaf2a160cb48786b80189c812cdb55 to your computer and use it in GitHub Desktop.
Save Juanpe/61eaf2a160cb48786b80189c812cdb55 to your computer and use it in GitHub Desktop.
struct Logger {
enum LogStyle {
case lowercase
case uppercase
case capitalized
}
let style: LogStyle
func log(_ message: String) {
switch style {
case .lowercase:
print(message.lowercased())
case .uppercase:
print(message.uppercased())
case .capitalized:
print(message.capitalized)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment