Skip to content
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

Merged
merged 17 commits into from
Jul 29, 2023
Merged

[DIA-2473] manage package #4

merged 17 commits into from
Jul 29, 2023

Conversation

Nevazhnovu
Copy link
Collaborator

No description provided.

@@ -51,6 +60,12 @@ public static void Initialize(List<SpCampaign> spCampaigns, int accountId, strin

public static void LoadMessage(string authId = null)
{
if (IsEditor)
Copy link
Member

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) .

Copy link
Collaborator Author

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

Copy link
Member

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();

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@Nevazhnovu Nevazhnovu merged commit 07b4277 into develop Jul 29, 2023
@andresilveirah andresilveirah deleted the DIA-2473-manage-package branch February 26, 2024 12:05
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