-
Notifications
You must be signed in to change notification settings - Fork 3
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
[DIA-2473] manage package #4
Conversation
@@ -51,6 +60,12 @@ public static void Initialize(List<SpCampaign> spCampaigns, int accountId, strin | |||
|
|||
public static void LoadMessage(string authId = null) | |||
{ | |||
if (IsEditor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we extract this logic to our own logger class? So you can always call the log method and inside the method you'd have that conditional if (IsEditor)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning message is a bit different in each and every call so I'd rather leave it as it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just a matter of receiving the message as a parameter :)
interface Logger
{
void log(string message);
}
class EditorLogger: Logger
{
public void log(string message) {}
}
class NonEditorLogger: Logger
{
public void log(string message)
{
Debug.LogWarning(message);
}
}
// somewhere in the code
public Logger logger = isEditor ? new EditorLogger() : new NonEditorLogger();
No description provided.